Merge in tip changes

This commit is contained in:
Brian Sidebotham 2014-02-19 19:41:29 +00:00
commit 0c9f1ef3e4
267 changed files with 1962 additions and 1904 deletions

View File

@ -2,7 +2,6 @@
include_directories(BEFORE ${INC_BEFORE})
include_directories(
../potrace
../polygon/kbool/include
../common
${INC_AFTER}
)

View File

@ -28,11 +28,6 @@
* @brief Message panel implementation file.
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include <msgpanel.h>

View File

@ -493,6 +493,10 @@ void CVPCB_MAINFRAME::LoadNetList( wxCommandEvent& event )
wxGetApp().GetLibraryPathList().Insert( newFileName.GetPath(), 0 );
m_NetlistFileName = newFileName;
ReadNetListAndLinkFiles();
// OSX need it since some objects are "rebuild" just make aware AUI
// Fixes #1258081
m_auimgr.Update();
}

View File

@ -286,7 +286,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
int aConvert, GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor, const TRANSFORM& aTransform,
bool aShowPinText, bool aDrawFields, bool aOnlySelected )
{
BASE_SCREEN* screen = aPanel->GetScreen();
BASE_SCREEN* screen = aPanel ? aPanel->GetScreen() : NULL;
GRSetDrawMode( aDc, aDrawMode );
@ -296,7 +296,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
* printing in black and white
* If the color is not the default color (aColor != -1 )
*/
if( ! (screen->m_IsPrinting && GetGRForceBlackPenState())
if( ! (screen && screen->m_IsPrinting && GetGRForceBlackPenState())
&& (aColor == UNSPECIFIED_COLOR) )
{
BOOST_FOREACH( LIB_ITEM& drawItem, drawings )
@ -372,10 +372,11 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
// Enable this to draw the anchor of the component.
#if 0
int len = aDc->DeviceToLogicalXRel( 3 );
EDA_RECT* const clipbox = aPanel ? aPanel->GetClipBox() : NULL;
GRLine( aPanel->GetClipBox(), aDc, aOffset.x, aOffset.y - len, aOffset.x,
GRLine( clipbox, aDc, aOffset.x, aOffset.y - len, aOffset.x,
aOffset.y + len, 0, aColor );
GRLine( aPanel->GetClipBox(), aDc, aOffset.x - len, aOffset.y, aOffset.x + len,
GRLine( clipbox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len,
aOffset.y, 0, aColor );
#endif
@ -383,7 +384,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
* the bounding box calculations. */
#if 0
EDA_RECT bBox = GetBoundingBox( aMulti, aConvert );
GRRect( aPanel->GetClipBox(), aDc, bBox.GetOrigin().x, bBox.GetOrigin().y,
GRRect( aPanel ? aPanel->GetClipBox() : NULL, aDc, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}

View File

@ -403,7 +403,7 @@ public:
/**
* Draw component.
*
* @param aPanel - Window to draw on.
* @param aPanel - Window to draw on. Can be NULL if not available.
* @param aDc - Device context to draw on.
* @param aOffset - Position to component.
* @param aMulti - Component unit if multiple parts per component.

View File

@ -44,14 +44,19 @@ static const unsigned kLowestDefaultScore = 1;
struct COMPONENT_TREE_SEARCH_CONTAINER::TREE_NODE
{
TREE_NODE(TREE_NODE* aParent, CMP_LIBRARY* aOwningLib,
// Levels of nodes.
enum NODE_TYPE {
TYPE_LIB,
TYPE_ALIAS,
TYPE_UNIT
};
TREE_NODE(NODE_TYPE aType, TREE_NODE* aParent, LIB_ALIAS* aAlias,
const wxString& aName, const wxString& aDisplayInfo,
const wxString& aSearchText,
bool aNormallyExpanded = false)
: Parent( aParent ),
Lib( aOwningLib ),
NormallyExpanded( aNormallyExpanded ),
Name( aName ),
const wxString& aSearchText )
: Type( aType ),
Parent( aParent ), Alias( aAlias ), Unit( 0 ),
DisplayName( aName ),
DisplayInfo( aDisplayInfo ),
MatchName( aName.Lower() ),
SearchText( aSearchText.Lower() ),
@ -59,10 +64,11 @@ struct COMPONENT_TREE_SEARCH_CONTAINER::TREE_NODE
{
}
TREE_NODE* const Parent; ///< NULL if library, pointer to lib-node when component.
CMP_LIBRARY* const Lib; ///< Owning library of this component.
const bool NormallyExpanded; ///< If this is a parent node, should it be unfolded ?
const wxString Name; ///< Exact name as displayed to the user.
const NODE_TYPE Type; ///< Type of node in the hierarchy.
TREE_NODE* const Parent; ///< NULL if library, pointer to parent when component/alias.
LIB_ALIAS* const Alias; ///< Component alias associated with this entry.
int Unit; ///< Part number; Assigned: >= 1; default = 0
const wxString DisplayName; ///< Exact name as displayed to the user.
const wxString DisplayInfo; ///< Additional info displayed in the tree (description..)
const wxString MatchName; ///< Preprocessed: lowercased display name.
@ -75,27 +81,25 @@ struct COMPONENT_TREE_SEARCH_CONTAINER::TREE_NODE
// Sort tree nodes by reverse match-score (bigger is first), then alphabetically.
// Library nodes (i.e. the ones that don't have a parent) are always sorted before any
// leaf nodes.
// Library (i.e. the ones that don't have a parent) are always sorted before any
// leaf nodes. Component
bool COMPONENT_TREE_SEARCH_CONTAINER::scoreComparator( const TREE_NODE* a1, const TREE_NODE* a2 )
{
if ( a1->Parent == NULL && a2->Parent != NULL )
return true;
if( a1->Type != a2->Type )
return a1->Type < a2->Type;
if ( a1->Parent != NULL && a2->Parent == NULL )
return false;
if ( a1->MatchScore != a2->MatchScore )
if( a1->MatchScore != a2->MatchScore )
return a1->MatchScore > a2->MatchScore; // biggest first.
if (a1->Parent != a2->Parent)
return a1->Parent->MatchName.Cmp(a2->Parent->MatchName) < 0;
if( a1->Parent != a2->Parent )
return scoreComparator( a1->Parent, a2->Parent );
return a1->MatchName.Cmp( a2->MatchName ) < 0;
}
COMPONENT_TREE_SEARCH_CONTAINER::COMPONENT_TREE_SEARCH_CONTAINER()
: tree( NULL )
: tree( NULL ), libraries_added( 0 ), preselect_unit_number( -1 )
{
}
@ -108,9 +112,11 @@ COMPONENT_TREE_SEARCH_CONTAINER::~COMPONENT_TREE_SEARCH_CONTAINER()
}
void COMPONENT_TREE_SEARCH_CONTAINER::SetPreselectNode( const wxString& aComponentName )
void COMPONENT_TREE_SEARCH_CONTAINER::SetPreselectNode( const wxString& aComponentName,
int aUnit )
{
preselect_node_name = aComponentName.Lower();
preselect_unit_number = aUnit;
}
@ -123,71 +129,79 @@ void COMPONENT_TREE_SEARCH_CONTAINER::SetTree( wxTreeCtrl* aTree )
void COMPONENT_TREE_SEARCH_CONTAINER::AddLibrary( CMP_LIBRARY& aLib )
{
wxArrayString all_comp;
wxArrayString all_aliases;
aLib.GetEntryNames( all_comp );
AddComponentList( aLib.GetName(), all_comp, &aLib, false );
aLib.GetEntryNames( all_aliases );
AddAliasList( aLib.GetName(), all_aliases, &aLib );
++libraries_added;
}
void COMPONENT_TREE_SEARCH_CONTAINER::AddComponentList( const wxString& aNodeName,
const wxArrayString& aComponentNameList,
CMP_LIBRARY* aOptionalLib,
bool aNormallyExpanded )
void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
const wxArrayString& aAliasNameList,
CMP_LIBRARY* aOptionalLib )
{
TREE_NODE* parent_node = new TREE_NODE( NULL, NULL, aNodeName, wxEmptyString, wxEmptyString,
aNormallyExpanded );
static const wxChar unitLetter[] = wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
nodes.push_back( parent_node );
TREE_NODE* const lib_node = new TREE_NODE( TREE_NODE::TYPE_LIB, NULL, NULL,
aNodeName, wxEmptyString, wxEmptyString );
nodes.push_back( lib_node );
BOOST_FOREACH( const wxString& cName, aComponentNameList )
BOOST_FOREACH( const wxString& aName, aAliasNameList )
{
LIB_COMPONENT *c;
LIB_ALIAS* a;
if (aOptionalLib)
c = aOptionalLib->FindComponent( cName );
if( aOptionalLib )
a = aOptionalLib->FindAlias( aName );
else
c = CMP_LIBRARY::FindLibraryComponent( cName, wxEmptyString );
a = CMP_LIBRARY::FindLibraryEntry( aName, wxEmptyString );
if (c == NULL)
if( a == NULL )
continue;
wxString keywords, descriptions;
wxString search_text;
search_text = ( a->GetKeyWords().empty() ) ? wxT(" ") : a->GetKeyWords();
search_text += a->GetDescription();
wxString display_info;
for ( size_t i = 0; i < c->GetAliasCount(); ++i )
if( !a->GetDescription().empty() )
{
LIB_ALIAS *a = c->GetAlias( i );
keywords += a->GetKeyWords();
descriptions += a->GetDescription();
if ( display_info.empty() && !a->GetDescription().empty() )
{
// Preformatting. Unfortunately, the tree widget doesn't have columns
display_info.Printf( wxT(" %s[ %s ]"),
( cName.length() <= 8 ) ? wxT("\t\t") : wxT("\t"),
GetChars( a->GetDescription() ) );
}
// Preformatting. Unfortunately, the tree widget doesn't have columns
display_info.Printf( wxT(" %s[ %s ]"),
( a->GetName().length() <= 8 ) ? wxT("\t\t") : wxT("\t"),
GetChars( a->GetDescription() ) );
}
// If there are no keywords, we give a couple of characters whitespace penalty. We want
// a component with a search-term found in the keywords score slightly higher than another
// component without keywords, but that term in the descriptions.
wxString search_text = ( !keywords.empty() ) ? keywords : wxT(" ");
search_text += descriptions;
nodes.push_back( new TREE_NODE( parent_node, c->GetLibrary(),
cName, display_info, search_text ) );
TREE_NODE* alias_node = new TREE_NODE( TREE_NODE::TYPE_ALIAS, lib_node,
a, a->GetName(), display_info, search_text );
nodes.push_back( alias_node );
if( a->GetComponent()->IsMulti() ) // Add all units as sub-nodes.
for ( int u = 0; u < a->GetComponent()->GetPartCount(); ++u )
{
const wxString unitName = unitLetter[u];
TREE_NODE* unit_node = new TREE_NODE(TREE_NODE::TYPE_UNIT, alias_node, a,
_("Unit ") + unitName,
wxEmptyString, wxEmptyString );
unit_node->Unit = u + 1;
nodes.push_back( unit_node );
}
}
}
LIB_COMPONENT* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedComponent()
LIB_ALIAS* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedAlias( int* aUnit )
{
const wxTreeItemId& select_id = tree->GetSelection();
BOOST_FOREACH( TREE_NODE* node, nodes )
{
if ( node->MatchScore > 0 && node->TreeId == select_id && node->Lib )
return node->Lib->FindComponent( node->Name );
if( node->MatchScore > 0 && node->TreeId == select_id ) {
if( aUnit && node->Unit > 0 )
*aUnit = node->Unit;
return node->Alias;
}
}
return NULL;
}
@ -209,7 +223,7 @@ static int matchPosScore(int aPosition, int aMaximum)
void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch )
{
if ( tree == NULL )
if( tree == NULL )
return;
// We score the list by going through it several time, essentially with a complexity
@ -220,7 +234,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
BOOST_FOREACH( TREE_NODE* node, nodes )
{
node->PreviousScore = node->MatchScore;
node->MatchScore = node->Parent ? kLowestDefaultScore : 0; // start-match for leafs.
node->MatchScore = ( node->Type == TREE_NODE::TYPE_LIB ) ? 0 : kLowestDefaultScore;
}
// Create match scores for each node for all the terms, that come space-separated.
@ -239,12 +253,13 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
while ( tokenizer.HasMoreTokens() )
{
const wxString term = tokenizer.GetNextToken().Lower();
BOOST_FOREACH( TREE_NODE* node, nodes )
{
if ( node->Parent == NULL)
continue; // Library nodes are not scored here.
if( node->Type != TREE_NODE::TYPE_ALIAS )
continue; // Only aliases are actually scored here.
if ( node->MatchScore == 0)
if( node->MatchScore == 0)
continue; // Leaf node without score are out of the game.
// Keywords and description we only count if the match string is at
@ -252,16 +267,16 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
// matches. Most abbreviations are at three characters long.
int found_pos;
if ( term == node->MatchName )
if( term == node->MatchName )
node->MatchScore += 1000; // exact match. High score :)
else if ( (found_pos = node->MatchName.Find( term ) ) != wxNOT_FOUND )
else if( (found_pos = node->MatchName.Find( term ) ) != wxNOT_FOUND )
{
// Substring match. The earlier in the string the better. score += 20..40
node->MatchScore += matchPosScore( found_pos, 20 ) + 20;
}
else if ( node->Parent->MatchName.Find( term ) != wxNOT_FOUND )
else if( node->Parent->MatchName.Find( term ) != wxNOT_FOUND )
node->MatchScore += 19; // parent name matches. score += 19
else if ( ( found_pos = node->SearchText.Find( term ) ) != wxNOT_FOUND )
else if( ( found_pos = node->SearchText.Find( term ) ) != wxNOT_FOUND )
{
// If we have a very short search term (like one or two letters), we don't want
// to accumulate scores if they just happen to be in keywords or description as
@ -277,22 +292,35 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
}
}
// Parent nodes have the maximum score seen in any of their children.
// Library nodes have the maximum score seen in any of their children.
// Alias nodes have the score of their parents.
unsigned highest_score_seen = 0;
bool any_change = false;
BOOST_FOREACH( TREE_NODE* node, nodes )
{
if ( node->Parent == NULL )
continue;
switch( node->Type )
{
case TREE_NODE::TYPE_ALIAS:
{
any_change |= (node->PreviousScore != node->MatchScore);
// Update library score.
node->Parent->MatchScore = std::max( node->Parent->MatchScore, node->MatchScore );
highest_score_seen = std::max( highest_score_seen, node->MatchScore );
}
break;
any_change |= (node->PreviousScore != node->MatchScore);
node->Parent->MatchScore = std::max( node->Parent->MatchScore, node->MatchScore );
highest_score_seen = std::max( highest_score_seen, node->MatchScore );
case TREE_NODE::TYPE_UNIT:
node->MatchScore = node->Parent->MatchScore;
break;
default:
break;
}
}
// The tree update might be slow, so we want to bail out if there is no change.
if ( !any_change )
if( !any_change )
return;
// Now: sort all items according to match score, libraries first.
@ -305,9 +333,10 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
const wxTreeItemId root_id = tree->AddRoot( wxEmptyString );
const TREE_NODE* first_match = NULL;
const TREE_NODE* preselected_node = NULL;
BOOST_FOREACH( TREE_NODE* node, nodes )
{
if ( node->MatchScore == 0 )
if( node->MatchScore == 0 )
continue;
// If we have nodes that go beyond the default score, suppress nodes that
@ -315,42 +344,50 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
// some one-letter match in the keyword or description. In this case, we prefer matches
// that just have higher scores. Improves relevancy and performance as the tree has to
// display less items.
if ( highest_score_seen > kLowestDefaultScore && node->MatchScore == kLowestDefaultScore )
if( highest_score_seen > kLowestDefaultScore && node->MatchScore == kLowestDefaultScore )
continue;
const bool isLeaf = ( node->Parent != NULL );
wxString node_text;
#if 0
// Node text with scoring information for debugging
node_text.Printf( wxT("%s (s=%u)%s"), GetChars(node->Name),
node->MatchScore, GetChars(node->DisplayInfo));
node_text.Printf( wxT("%s (s=%u)%s"), GetChars(node->DisplayName),
node->MatchScore, GetChars( node->DisplayInfo ));
#else
node_text = node->Name + node->DisplayInfo;
node_text = node->DisplayName + node->DisplayInfo;
#endif
node->TreeId = tree->AppendItem( !isLeaf ? root_id : node->Parent->TreeId, node_text );
node->TreeId = tree->AppendItem( node->Parent ? node->Parent->TreeId : root_id,
node_text );
// If we are a leaf node, we might need to expand.
if ( isLeaf )
// If we are a nicely scored alias, we want to have it visible. Also, if there
// is only a single library in this container, we want to have it unfolded
// (example: power library).
if( node->Type == TREE_NODE::TYPE_ALIAS
&& ( node->MatchScore > kLowestDefaultScore || libraries_added == 1 ) )
{
if ( node->MatchScore > kLowestDefaultScore )
{
tree->EnsureVisible( node->TreeId );
tree->EnsureVisible( node->TreeId );
if ( first_match == NULL )
first_match = node; // The "I am feeling lucky" element.
}
if ( preselected_node == NULL && node->MatchName == preselect_node_name )
preselected_node = node;
if( first_match == NULL )
first_match = node; // First, highest scoring: the "I am feeling lucky" element.
}
if ( !isLeaf && node->NormallyExpanded )
tree->Expand( node->TreeId );
// The first node that matches our pre-select criteria is choosen. 'First node'
// means, it shows up in the history, as the history node is displayed very first
// (by virtue of alphabetical ordering)
if( preselected_node == NULL
&& node->Type == TREE_NODE::TYPE_ALIAS
&& node->MatchName == preselect_node_name )
preselected_node = node;
// Refinement in case we come accross a matching unit node.
if( preselected_node != NULL && preselected_node->Type == TREE_NODE::TYPE_ALIAS
&& node->Parent == preselected_node
&& preselect_unit_number >= 1 && node->Unit == preselect_unit_number )
preselected_node = node;
}
if ( first_match ) // Highest score search match pre-selected.
if( first_match ) // Highest score search match pre-selected.
tree->SelectItem( first_match->TreeId );
else if ( preselected_node ) // No search, so history item preselected.
else if( preselected_node ) // No search, so history item preselected.
tree->SelectItem( preselected_node->TreeId );
tree->Thaw();

View File

@ -21,11 +21,13 @@
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef COMPONENT_TREE_SEARCH_CONTAINER_H
#define COMPONENT_TREE_SEARCH_CONTAINER_H
#include <vector>
#include <wx/string.h>
class LIB_COMPONENT;
class LIB_ALIAS;
class CMP_LIBRARY;
class wxTreeCtrl;
class wxArrayString;
@ -44,7 +46,7 @@ public:
~COMPONENT_TREE_SEARCH_CONTAINER();
/** Function AddLibrary
* Add the components of this library to be searched.
* Add all the components and their aliases of this library to be searched.
* To be called in the setup phase to fill this container.
*
* @param aLib containting all the components to be added.
@ -56,19 +58,19 @@ public:
* To be called in the setup phase to fill this container.
*
* @param aNodeName The parent node name the components will show up as leaf.
* @param aComponentNameList List of component names.
* @param aAliasNameList List of alias names.
* @param aOptionalLib Library to look up the component names (if NULL: global lookup)
* @param aNormallyExpanded Should the node in the tree be expanded by default.
*/
void AddComponentList( const wxString& aNodeName, const wxArrayString& aComponentNameList,
CMP_LIBRARY* aOptionalLib, bool aNormallyExpanded );
void AddAliasList( const wxString& aNodeName, const wxArrayString& aAliasNameList,
CMP_LIBRARY* aOptionalLib );
/** Function SetPreselectNode
* Set the component name to be selected in absence of any search-result.
*
* @param aComponentName the component name to be selected.
* @param aUnit the component unit to be selected (if > 0).
*/
void SetPreselectNode( const wxString& aComponentName );
void SetPreselectNode( const wxString& aComponentName, int aUnit );
/** Function SetTree
* Set the tree to be manipulated.
@ -92,17 +94,23 @@ public:
*/
void UpdateSearchTerm( const wxString& aSearch );
/** Function GetSelectedComponent
/** Function GetSelectedAlias
*
* @return the selected component or NULL if there is none.
* @param if not-NULL, the selected sub-unit is set here.
* @return the selected alias or NULL if there is none.
*/
LIB_COMPONENT* GetSelectedComponent();
LIB_ALIAS* GetSelectedAlias( int* aUnit );
private:
struct TREE_NODE;
static bool scoreComparator( const TREE_NODE* a1, const TREE_NODE* a2 );
std::vector<TREE_NODE*> nodes;
wxString preselect_node_name;
wxTreeCtrl* tree;
int libraries_added;
wxString preselect_node_name;
int preselect_unit_number;
};
#endif /* COMPONENT_TREE_SEARCH_CONTAINER_H */

View File

@ -35,77 +35,36 @@
static wxTreeItemId GetPrevItem( const wxTreeCtrl& tree, const wxTreeItemId& item );
static wxTreeItemId GetNextItem( const wxTreeCtrl& tree, const wxTreeItemId& item );
// Combine descriptions of all aliases from given component.
static wxString combineDescriptions( LIB_COMPONENT* aComponent )
{
std::set<wxString> descriptions;
for( size_t i = 0; i < aComponent->GetAliasCount(); ++i )
{
LIB_ALIAS* a = aComponent->GetAlias( i );
if ( !a->GetDescription().empty() )
descriptions.insert( a->GetDescription() );
}
wxString result;
BOOST_FOREACH( const wxString& s, descriptions )
result += s + wxT("\n");
return result;
}
// Combine keywords. Keywords come as a string, but are considered space-separated
// individual words. Return a string with a unique set of these.
static wxString combineKeywords( LIB_COMPONENT* aComponent )
{
std::set<wxString> keywords;
for( size_t i = 0; i < aComponent->GetAliasCount(); ++i )
{
LIB_ALIAS* a = aComponent->GetAlias( i );
wxStringTokenizer tokenizer( a->GetKeyWords() );
while ( tokenizer.HasMoreTokens() )
keywords.insert( tokenizer.GetNextToken() );
}
wxString result;
BOOST_FOREACH( const wxString& s, keywords )
result += s + wxT(" ");
return result;
}
DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxString& aTitle,
COMPONENT_TREE_SEARCH_CONTAINER* aContainer )
COMPONENT_TREE_SEARCH_CONTAINER* aContainer,
int aDeMorganConvert )
: DIALOG_CHOOSE_COMPONENT_BASE( aParent, wxID_ANY, aTitle ),
m_search_container( aContainer ),
m_selected_component( NULL ),
m_deMorganConvert( aDeMorganConvert >= 0 ? aDeMorganConvert : 0 ),
m_external_browser_requested( false ),
m_received_doubleclick_in_tree( false )
{
// TODO: restore last size user was choosing.
m_search_container->SetTree( m_libraryComponentTree );
m_searchBox->SetFocus();
m_componentDetails->SetEditable( false );
}
// After this dialog is done: return the component that has been selected, or an
// After this dialog is done: return the alias that has been selected, or an
// empty string if there is none.
wxString DIALOG_CHOOSE_COMPONENT::GetSelectedComponentName() const
wxString DIALOG_CHOOSE_COMPONENT::GetSelectedAliasName( int* aUnit ) const
{
if ( m_selected_component == NULL )
return wxEmptyString;
LIB_ALIAS *alias = m_search_container->GetSelectedAlias( aUnit );
return m_selected_component->GetName();
if( alias )
return alias->GetName();
return wxEmptyString;
}
void DIALOG_CHOOSE_COMPONENT::OnSearchBoxChange( wxCommandEvent& aEvent )
{
m_selected_component = NULL;
m_search_container->UpdateSearchTerm( m_searchBox->GetLineText(0) );
updateSelection();
}
@ -117,31 +76,50 @@ void DIALOG_CHOOSE_COMPONENT::OnSearchBoxEnter( wxCommandEvent& aEvent )
}
void DIALOG_CHOOSE_COMPONENT::SelectIfValid( const wxTreeItemId& aTreeId )
void DIALOG_CHOOSE_COMPONENT::selectIfValid( const wxTreeItemId& aTreeId )
{
if ( aTreeId.IsOk() && aTreeId != m_libraryComponentTree->GetRootItem() )
if( aTreeId.IsOk() && aTreeId != m_libraryComponentTree->GetRootItem() )
m_libraryComponentTree->SelectItem( aTreeId );
}
void DIALOG_CHOOSE_COMPONENT::OnInterceptSearchBoxKey( wxKeyEvent& aKeyStroke )
{
// Cursor up/down are forwarded to the tree. This is done by intercepting some navigational
// keystrokes that normally would go to the text search box (which has the focus by default).
// Cursor up/down and partiallyi cursor are use to do tree navigation operations.
// This is done by intercepting some navigational keystrokes that normally would go to
// the text search box (which has the focus by default). That way, we are mostly keyboard
// operable.
// (If the tree has the focus, it can handle that by itself).
const wxTreeItemId sel = m_libraryComponentTree->GetSelection();
switch ( aKeyStroke.GetKeyCode() )
switch( aKeyStroke.GetKeyCode() )
{
case WXK_UP:
SelectIfValid( GetPrevItem( *m_libraryComponentTree, sel ) );
selectIfValid( GetPrevItem( *m_libraryComponentTree, sel ) );
break;
case WXK_DOWN:
SelectIfValid( GetNextItem( *m_libraryComponentTree, sel ) );
selectIfValid( GetNextItem( *m_libraryComponentTree, sel ) );
break;
// The follwoing keys we can only hijack if they are not needed by the textbox itself.
case WXK_LEFT:
if( m_searchBox->GetInsertionPoint() == 0 )
m_libraryComponentTree->Collapse( sel );
else
aKeyStroke.Skip(); // Use for original purpose: move cursor.
break;
case WXK_RIGHT:
if( m_searchBox->GetInsertionPoint() >= (long) m_searchBox->GetLineText( 0 ).length() )
m_libraryComponentTree->Expand( sel );
else
aKeyStroke.Skip(); // Use for original purpose: move cursor.
break;
default:
aKeyStroke.Skip(); // Pass on to search box.
aKeyStroke.Skip(); // Any other key: pass on to search box directly.
break;
}
}
@ -155,9 +133,7 @@ void DIALOG_CHOOSE_COMPONENT::OnTreeSelect( wxTreeEvent& aEvent )
void DIALOG_CHOOSE_COMPONENT::OnDoubleClickTreeSelect( wxTreeEvent& aEvent )
{
updateSelection();
if ( m_selected_component == NULL )
if( !updateSelection() )
return;
// Ok, got selection. We don't just end the modal dialog here, but
@ -170,7 +146,7 @@ void DIALOG_CHOOSE_COMPONENT::OnDoubleClickTreeSelect( wxTreeEvent& aEvent )
void DIALOG_CHOOSE_COMPONENT::OnTreeMouseUp( wxMouseEvent& aMouseEvent )
{
if ( m_received_doubleclick_in_tree )
if( m_received_doubleclick_in_tree )
EndModal( wxID_OK ); // We are done (see OnDoubleClickTreeSelect)
else
aMouseEvent.Skip(); // Let upstream handle it.
@ -184,20 +160,19 @@ void DIALOG_CHOOSE_COMPONENT::OnStartComponentBrowser( wxMouseEvent& aEvent )
}
void DIALOG_CHOOSE_COMPONENT::updateSelection()
bool DIALOG_CHOOSE_COMPONENT::updateSelection()
{
LIB_COMPONENT* selection = m_search_container->GetSelectedComponent();
int unit = 0;
LIB_ALIAS* selection = m_search_container->GetSelectedAlias( &unit );
if ( selection == m_selected_component )
return; // no change.
m_selected_component = selection;
m_componentView->Refresh();
m_componentDetails->Clear();
if ( m_selected_component == NULL )
return;
if( selection == NULL )
return false;
m_componentDetails->Freeze();
wxFont font_normal = m_componentDetails->GetFont();
wxFont font_bold = m_componentDetails->GetFont();
font_bold.SetWeight( wxFONTWEIGHT_BOLD );
@ -207,20 +182,20 @@ void DIALOG_CHOOSE_COMPONENT::updateSelection()
wxTextAttr text_attribute;
text_attribute.SetFont(font_normal);
const wxString description = combineDescriptions( selection );
const wxString description = selection->GetDescription();
if ( !description.empty() )
if( !description.empty() )
{
m_componentDetails->SetDefaultStyle( headline_attribute );
m_componentDetails->AppendText( _("Description\n") );
m_componentDetails->SetDefaultStyle( text_attribute );
m_componentDetails->AppendText( description );
m_componentDetails->AppendText( wxT("\n") );
m_componentDetails->AppendText( wxT("\n\n") );
}
const wxString keywords = combineKeywords( selection );
const wxString keywords = selection->GetKeyWords();
if ( !keywords.empty() )
if( !keywords.empty() )
{
m_componentDetails->SetDefaultStyle( headline_attribute );
m_componentDetails->AppendText( _("Keywords\n") );
@ -229,30 +204,90 @@ void DIALOG_CHOOSE_COMPONENT::updateSelection()
}
m_componentDetails->SetInsertionPoint( 0 ); // scroll up.
m_componentDetails->Thaw();
return true;
}
void DIALOG_CHOOSE_COMPONENT::OnHandlePreviewRepaint( wxPaintEvent& aRepaintEvent )
{
int unit = 0;
LIB_ALIAS* selection = m_search_container->GetSelectedAlias( &unit );
renderPreview( selection ? selection->GetComponent() : NULL, unit );
}
// Render the preview in our m_componentView. If this gets more complicated, we should
// probably have a derived class from wxPanel; but this keeps things local.
void DIALOG_CHOOSE_COMPONENT::renderPreview( LIB_COMPONENT* aComponent, int aUnit )
{
wxPaintDC dc( m_componentView );
dc.SetBackground( *wxWHITE_BRUSH );
dc.Clear();
if( aComponent == NULL )
return;
if( aUnit <= 0 )
aUnit = 1;
const wxSize dc_size = dc.GetSize();
dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
// Find joint bounding box for everything we are about to draw.
EDA_RECT bBox = aComponent->GetBoundingBox( aUnit, m_deMorganConvert );
const double xscale = (double) dc_size.x / bBox.GetWidth();
const double yscale = (double) dc_size.y / bBox.GetHeight();
const double scale = std::min( xscale, yscale ) * 0.85;
dc.SetUserScale( scale, scale );
wxPoint offset = bBox.Centre();
NEGATE( offset.x );
NEGATE( offset.y );
aComponent->Draw( NULL, &dc, offset, aUnit, m_deMorganConvert, GR_COPY,
UNSPECIFIED_COLOR, DefaultTransform, true, true, false );
}
static wxTreeItemId GetPrevItem( const wxTreeCtrl& tree, const wxTreeItemId& item )
{
wxTreeItemId prevItem = tree.GetPrevSibling( item );
if ( !prevItem.IsOk() )
if( !prevItem.IsOk() )
{
const wxTreeItemId parent = tree.GetItemParent( item );
prevItem = tree.GetLastChild( tree.GetPrevSibling( parent ) );
prevItem = tree.GetItemParent( item );
}
else if( tree.IsExpanded( prevItem ) )
{
prevItem = tree.GetLastChild( prevItem );
}
return prevItem;
}
static wxTreeItemId GetNextItem( const wxTreeCtrl& tree, const wxTreeItemId& item )
{
wxTreeItemId nextItem = tree.GetNextSibling( item );
wxTreeItemId nextItem;
if ( !nextItem.IsOk() )
if( tree.IsExpanded( item ) )
{
const wxTreeItemId parent = tree.GetItemParent( item );
wxTreeItemIdValue dummy;
nextItem = tree.GetFirstChild( tree.GetNextSibling( parent ), dummy );
nextItem = tree.GetFirstChild( item, dummy );
}
else
{
// Walk up levels until we find one that has a next sibling.
for ( wxTreeItemId walk = item; walk.IsOk(); walk = tree.GetItemParent( walk ) )
{
nextItem = tree.GetNextSibling( walk );
if( nextItem.IsOk() )
break;
}
}
return nextItem;

View File

@ -21,6 +21,8 @@
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIALOG_CHOOSE_COMPONENT_H
#define DIALOG_CHOOSE_COMPONENT_H
#include <dialog_choose_component_base.h>
@ -32,14 +34,16 @@ class DIALOG_CHOOSE_COMPONENT : public DIALOG_CHOOSE_COMPONENT_BASE
{
public:
DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxString& aTitle,
COMPONENT_TREE_SEARCH_CONTAINER* aSearch_container );
COMPONENT_TREE_SEARCH_CONTAINER* aSearch_container,
int aDeMorganConvert );
/** Function GetSelectedComponentName
/** Function GetSelectedAliasName
* To be called after this dialog returns from ShowModal().
*
* @return the component that has been selected, or an empty string if there is none.
* @param aUnit if not NULL, the selected unit is filled in here.
* @return the alias that has been selected, or an empty string if there is none.
*/
wxString GetSelectedComponentName() const;
wxString GetSelectedAliasName( int* aUnit ) const;
/** Function IsExternalBrowserSelected
*
@ -57,13 +61,17 @@ protected:
virtual void OnTreeMouseUp( wxMouseEvent& aMouseEvent );
virtual void OnStartComponentBrowser( wxMouseEvent& aEvent );
virtual void OnHandlePreviewRepaint( wxPaintEvent& aRepaintEvent );
private:
void updateSelection();
void SelectIfValid( const wxTreeItemId& aTreeId );
bool updateSelection();
void selectIfValid( const wxTreeItemId& aTreeId );
void renderPreview( LIB_COMPONENT* aComponent, int aUnit );
COMPONENT_TREE_SEARCH_CONTAINER* const m_search_container;
LIB_COMPONENT* m_selected_component;
const int m_deMorganConvert;
bool m_external_browser_requested;
bool m_received_doubleclick_in_tree;
};
#endif /* DIALOG_CHOOSE_COMPONENT_H */

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// C++ code generated with wxFormBuilder (version Feb 8 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -11,7 +11,7 @@
DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( 450,-1 ), wxDefaultSize );
this->SetSizeHints( wxSize( 450,100 ), wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
@ -37,35 +37,21 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_componentView = new wxStaticText( this, wxID_ANY, wxT("TODO\n(mini. comp image)"), wxDefaultPosition, wxSize( 100,100 ), 0 );
m_componentView->Wrap( -1 );
m_componentView->SetMinSize( wxSize( 100,100 ) );
m_componentView = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentView->SetMinSize( wxSize( 150,150 ) );
bSizer3->Add( m_componentView, 0, wxALL, 5 );
bSizer3->Add( m_componentView, 2, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );
m_componentDetails = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE );
m_componentDetails->SetMinSize( wxSize( -1,100 ) );
m_componentDetails = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,100 ), wxTE_MULTILINE );
bSizer6->Add( m_componentDetails, 1, wxALL|wxEXPAND, 5 );
m_unitChoice = new wxComboBox( this, wxID_ANY, wxT("Unit A"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_unitChoice->Enable( false );
m_unitChoice->Hide();
bSizer6->Add( m_unitChoice, 0, wxALL, 5 );
bSizer3->Add( bSizer6, 2, wxEXPAND, 5 );
bSizer3->Add( m_componentDetails, 3, wxALL|wxEXPAND, 5 );
bSizer1->Add( bSizer3, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
bSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer5 = new wxBoxSizer( wxVERTICAL );
m_button = new wxStdDialogButtonSizer();
m_buttonOK = new wxButton( this, wxID_OK );
@ -77,7 +63,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
bSizer5->Add( m_button, 0, wxEXPAND, 5 );
bSizer1->Add( bSizer5, 0, wxEXPAND, 5 );
bSizer1->Add( bSizer5, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizer1 );
@ -93,6 +79,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_libraryComponentTree->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeSelect ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeSelect ), NULL, this );
m_componentView->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnStartComponentBrowser ), NULL, this );
m_componentView->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnHandlePreviewRepaint ), NULL, this );
}
DIALOG_CHOOSE_COMPONENT_BASE::~DIALOG_CHOOSE_COMPONENT_BASE()
@ -105,5 +92,6 @@ DIALOG_CHOOSE_COMPONENT_BASE::~DIALOG_CHOOSE_COMPONENT_BASE()
m_libraryComponentTree->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeSelect ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeSelect ), NULL, this );
m_componentView->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnStartComponentBrowser ), NULL, this );
m_componentView->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnHandlePreviewRepaint ), NULL, this );
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="11" />
<FileVersion major="1" minor="12" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -41,7 +41,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">450,-1</property>
<property name="minimum_size">450,100</property>
<property name="name">DIALOG_CHOOSE_COMPONENT_BASE</property>
<property name="pos"></property>
<property name="size">450,500</property>
@ -389,11 +389,11 @@
<property name="name">bSizer3</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">2</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -421,13 +421,12 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">TODO&#x0A;(mini. comp image)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">100,100</property>
<property name="minimum_size">150,150</property>
<property name="moveable">1</property>
<property name="name">m_componentView</property>
<property name="pane_border">1</property>
@ -438,15 +437,13 @@
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">100,100</property>
<property name="style"></property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -463,7 +460,7 @@
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnPaint">OnHandlePreviewRepaint</event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
@ -472,197 +469,95 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">2</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer6</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,100</property>
<property name="moveable">1</property>
<property name="name">m_componentDetails</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">-1,-1</property>
<property name="style">wxTE_MULTILINE</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxComboBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">0</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">1</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_unitChoice</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">-1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value">Unit A</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCombobox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">3</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,100</property>
<property name="moveable">1</property>
<property name="name">m_componentDetails</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">-1,-1</property>
<property name="style">wxTE_MULTILINE</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// C++ code generated with wxFormBuilder (version Feb 8 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -22,7 +22,7 @@ class DIALOG_SHIM;
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/treectrl.h>
#include <wx/combobox.h>
#include <wx/panel.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -40,9 +40,8 @@ class DIALOG_CHOOSE_COMPONENT_BASE : public DIALOG_SHIM
wxStaticText* m_searchLabel;
wxTextCtrl* m_searchBox;
wxTreeCtrl* m_libraryComponentTree;
wxStaticText* m_componentView;
wxPanel* m_componentView;
wxTextCtrl* m_componentDetails;
wxComboBox* m_unitChoice;
wxStdDialogButtonSizer* m_button;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
@ -55,6 +54,7 @@ class DIALOG_CHOOSE_COMPONENT_BASE : public DIALOG_SHIM
virtual void OnDoubleClickTreeSelect( wxTreeEvent& event ) { event.Skip(); }
virtual void OnTreeSelect( wxTreeEvent& event ) { event.Skip(); }
virtual void OnStartComponentBrowser( wxMouseEvent& event ) { event.Skip(); }
virtual void OnHandlePreviewRepaint( wxPaintEvent& event ) { event.Skip(); }
public:

View File

@ -205,7 +205,7 @@ bool EDA_APP::OnInit()
// wxSetWorkingDirectory does not like empty paths
wxSetWorkingDirectory( filename.GetPath() );
if( frame->LoadOneEEProject( filename.GetFullPath(), false ) )
if( frame->LoadOneEEProject( filename.GetFullName(), false ) )
frame->GetCanvas()->Refresh( true );
}
else

View File

@ -81,6 +81,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void )
wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
wxArrayString& aHistoryList,
int& aHistoryLastUnit,
bool aUseLibBrowser,
int* aUnit,
int* aConvert )
@ -113,17 +114,18 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
{
// This is good for a transition for experineced users: giving them a History. Ideally,
// we actually make this part even faster to access with a popup on ALT-a or something.
search_container.AddComponentList( _("-- History --"), aHistoryList, NULL, true );
search_container.SetPreselectNode( aHistoryList[0] );
search_container.AddAliasList( _("-- History --"), aHistoryList, NULL );
search_container.SetPreselectNode( aHistoryList[0], aHistoryLastUnit );
}
const int deMorgan = aConvert ? *aConvert : 1;
dialogTitle.Printf( _( "Choose Component (%d items loaded)" ), cmpCount );
DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, &search_container );
DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, &search_container, deMorgan );
if( dlg.ShowModal() == wxID_CANCEL )
return wxEmptyString;
wxString cmpName = dlg.GetSelectedComponentName();
wxString cmpName = dlg.GetSelectedAliasName( aUnit );
if( dlg.IsExternalBrowserSelected() )
{
@ -137,7 +139,10 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
}
if ( !cmpName.empty() )
{
AddHistoryComponentName( aHistoryList, cmpName );
if ( aUnit ) aHistoryLastUnit = *aUnit;
}
return cmpName;
}
@ -146,6 +151,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* aDC,
const wxString& aLibname,
wxArrayString& aHistoryList,
int& aHistoryLastUnit,
bool aUseLibBrowser )
{
int unit = 1;
@ -153,8 +159,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* aDC,
SetRepeatItem( NULL );
m_canvas->SetIgnoreMouseEvents( true );
wxString Name = SelectComponentFromLibrary( aLibname, aHistoryList, aUseLibBrowser,
&unit, &convert );
wxString Name = SelectComponentFromLibrary( aLibname, aHistoryList, aHistoryLastUnit,
aUseLibBrowser, &unit, &convert );
if( Name.IsEmpty() )
{

View File

@ -447,16 +447,18 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
if( aColor >= 0 )
fill = NO_FILL;
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
{
GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2,
GRFilledArc( clipbox, aDC, posc.x, posc.y, pt1, pt2,
m_Radius, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ),
GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
}
else if( fill == FILLED_SHAPE && !aData )
{
GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius,
GRFilledArc( clipbox, aDC, posc.x, posc.y, pt1, pt2, m_Radius,
color, color );
}
else
@ -464,11 +466,11 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
#ifdef DRAW_ARC_WITH_ANGLE
GRArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius,
GRArc( clipbox, aDC, posc.x, posc.y, pt1, pt2, m_Radius,
GetPenSize(), color );
#else
GRArc1( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GRArc1( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
posc.x, posc.y, GetPenSize(), color );
#endif
}
@ -477,7 +479,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
* calculation. */
#if 0
EDA_RECT bBox = GetBoundingBox();
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
GRRect( clipbox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}

View File

@ -231,20 +231,21 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
if( aColor >= 0 )
fill = NO_FILL;
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(),
GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(),
(m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ),
GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, 0, color, color );
GRFilledCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, 0, color, color );
else
GRCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );
GRCircle( clipbox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );
/* Set to one (1) to draw bounding box around circle to validate bounding
* box calculation. */
#if 0
EDA_RECT bBox = GetBoundingBox();
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
GRRect( clipbox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}

View File

@ -296,15 +296,16 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
GRSetDrawMode( aDC, aDrawMode );
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
(m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ),
GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
color, color );
else
GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(),
GRPoly( clipbox, aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(),
color, color );
delete[] buffer;
@ -314,7 +315,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
#if 0
EDA_RECT bBox = GetBoundingBox();
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
GRRect( clipbox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}

View File

@ -222,22 +222,23 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GRSetDrawMode( aDC, aDrawMode );
EDA_RECT* const clipbox = aPanel? aPanel->GetClipBox() : NULL;
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ),
GRFilledRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : GetLayerColor( LAYER_DEVICE_BACKGROUND ),
GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GRFilledRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GetPenSize(), color, color );
else
GRRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color );
GRRect( clipbox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color );
/* Set to one (1) to draw bounding box around rectangle to validate
* bounding box calculation. */
#if 0
EDA_RECT bBox = GetBoundingBox();
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
GRRect( clipbox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif
}

View File

@ -131,8 +131,10 @@ void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event )
return;
}
wxArrayString historyList;
CmpName = SelectComponentFromLibrary( m_library->GetName(), historyList, true, NULL, NULL );
wxArrayString dummyHistoryList;
int dummyLastUnit;
CmpName = SelectComponentFromLibrary( m_library->GetName(), dummyHistoryList, dummyLastUnit,
true, NULL, NULL );
if( CmpName.IsEmpty() )
return;

View File

@ -27,9 +27,6 @@
* @file eeschema/menubar.cpp
* @brief (Re)Create the main menubar for the schematic frame
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include <fctsys.h>
#include <appl_wxstruct.h>

View File

@ -46,8 +46,13 @@
#include <sch_bitmap.h>
// TODO(hzeller): These pairs of elmenets should be represented by an object, but don't want
// to refactor too much right now to not get in the way with other code changes.
static wxArrayString s_CmpNameList;
static int s_CmpLastUnit;
static wxArrayString s_PowerNameList;
static int s_LastPowerUnit;
void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
@ -294,7 +299,8 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_SCH_PLACE_COMPONENT:
if( (item == NULL) || (item->GetFlags() == 0) )
{
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) );
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString,
s_CmpNameList, s_CmpLastUnit, true ) );
m_canvas->SetAutoPanRequest( true );
}
else
@ -307,7 +313,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ),
s_PowerNameList, false ) );
s_PowerNameList, s_LastPowerUnit, false ) );
m_canvas->SetAutoPanRequest( true );
}
else

View File

@ -119,23 +119,25 @@ public:
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
* inline function.
* @param aPCB_VISIBLE is from the enum by the same name
* @param aElementCategory is from the enum by the same name
* @return bool - true if the element is visible.
* @see enum PCB_VISIBLE
*/
bool IsElementVisible( int aPCB_VISIBLE ) const
bool IsElementVisible( int aElementCategory ) const
{
return bool( m_VisibleElements & (1 << aPCB_VISIBLE) );
assert( aElementCategory >= 0 && aElementCategory < END_PCB_VISIBLE_LIST );
return ( m_VisibleElements & ( 1 << aElementCategory ) );
}
/**
* Function SetElementVisibility
* changes the visibility of an element category
* @param aPCB_VISIBLE is from the enum by the same name
* @param aElementCategory is from the enum by the same name
* @param aNewState = The new visibility state of the element category
* @see enum PCB_VISIBLE
*/
void SetElementVisibility( int aPCB_VISIBLE, bool aNewState );
void SetElementVisibility( int aElementCategory, bool aNewState );
/**
* Function GetEnabledLayers

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -445,7 +445,14 @@ namespace detail
# define GLM_RESTRICT __declspec(restrict)
# define GLM_RESTRICT_VAR __restrict
# define GLM_CONSTEXPR
#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
#elif(GLM_COMPILER & GLM_COMPILER_INTEL)
# define GLM_DEPRECATED
# define GLM_ALIGN(x) __declspec(align(x))
# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
# define GLM_RESTRICT
# define GLM_RESTRICT_VAR __restrict
# define GLM_CONSTEXPR
#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG))
# define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -60,8 +60,8 @@ namespace detail
typedef T value_type;
protected:
value_type& elem (size_t i) { return (reinterpret_cast<value_type*>(_buffer))[i]; }
const value_type& elem (size_t i) const { return (reinterpret_cast<const value_type*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast<value_type*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast<const value_type*>(_buffer))[i]; }
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
// The size 1 buffer is assumed to aligned to the actual members so that the
@ -77,19 +77,19 @@ namespace detail
template <typename T, typename V, int E0, int E1>
struct _swizzle_base1<T,V,E0,E1,-1,-2,2> : public _swizzle_base0<T,2>
{
V operator ()() const { return V(this->elem(E0), this->elem(E1)); }
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); }
};
template <typename T, typename V, int E0, int E1, int E2>
struct _swizzle_base1<T,V,E0,E1,E2,-1,3> : public _swizzle_base0<T,3>
{
V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); }
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); }
};
template <typename T, typename V, int E0, int E1, int E2, int E3>
struct _swizzle_base1<T,V,E0,E1,E2,E3,4> : public _swizzle_base0<T,4>
{
V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
};
// Internal class for implementing swizzle operators
@ -110,67 +110,73 @@ namespace detail
typedef VecType vec_type;
typedef ValueType value_type;
_swizzle_base2& operator= (const ValueType& t)
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t)
{
for (int i = 0; i < N; ++i)
(*this)[i] = t;
return *this;
}
_swizzle_base2& operator= (const VecType& that)
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that)
{
struct op {
void operator() (value_type& e, value_type& t) { e = t; }
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; }
};
_apply_op(that, op());
return *this;
}
void operator -= (const VecType& that)
GLM_FUNC_QUALIFIER void operator -= (const VecType& that)
{
struct op {
void operator() (value_type& e, value_type& t) { e -= t; }
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; }
};
_apply_op(that, op());
}
void operator += (const VecType& that)
GLM_FUNC_QUALIFIER void operator += (const VecType& that)
{
struct op {
void operator() (value_type& e, value_type& t) { e += t; }
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; }
};
_apply_op(that, op());
}
void operator *= (const VecType& that)
GLM_FUNC_QUALIFIER void operator *= (const VecType& that)
{
struct op {
void operator() (value_type& e, value_type& t) { e *= t; }
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; }
};
_apply_op(that, op());
}
void operator /= (const VecType& that)
GLM_FUNC_QUALIFIER void operator /= (const VecType& that)
{
struct op {
void operator() (value_type& e, value_type& t) { e /= t; }
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; }
};
_apply_op(that, op());
}
value_type& operator[] (size_t i)
GLM_FUNC_QUALIFIER value_type& operator[] (size_t i)
{
static const int offset_dst[4] = { E0, E1, E2, E3 };
#ifndef __CUDA_ARCH__
static
#endif
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
value_type operator[] (size_t i) const
GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const
{
static const int offset_dst[4] = { E0, E1, E2, E3 };
#ifndef __CUDA_ARCH__
static
#endif
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
protected:
template <typename T>
void _apply_op(const VecType& that, T op)
GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op)
{
// Make a copy of the data in this == &that.
// The copier should optimize out the copy in cases where the function is
@ -191,11 +197,14 @@ namespace detail
typedef ValueType value_type;
struct Stub {};
_swizzle_base2& operator= (Stub const &) {}
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; }
value_type operator[] (size_t i) const
GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const
{
static const int offset_dst[4] = { E0, E1, E2, E3 };
#ifndef __CUDA_ARCH__
static
#endif
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
};
@ -207,7 +216,7 @@ namespace detail
using base_type::operator=;
operator VecType () const { return (*this)(); }
GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); }
};
//
@ -223,17 +232,17 @@ namespace detail
//
#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
_GLM_SWIZZLE_TEMPLATE2 \
V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
{ \
return a() OPERAND b(); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \
{ \
return a() OPERAND b; \
} \
_GLM_SWIZZLE_TEMPLATE1 \
V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return a OPERAND b(); \
}
@ -243,12 +252,12 @@ namespace detail
//
#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
_GLM_SWIZZLE_TEMPLATE1 \
V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
{ \
return a() OPERAND b; \
} \
_GLM_SWIZZLE_TEMPLATE1 \
V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return a OPERAND b(); \
}
@ -258,7 +267,7 @@ namespace detail
//
#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \
{ \
return FUNCTION(a()); \
}
@ -268,22 +277,22 @@ namespace detail
//
#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \
_GLM_SWIZZLE_TEMPLATE2 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
{ \
return FUNCTION(a(), b()); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return FUNCTION(a(), b()); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \
{ \
return FUNCTION(a(), b); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return FUNCTION(a, b()); \
}
@ -293,22 +302,22 @@ namespace detail
//
#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \
_GLM_SWIZZLE_TEMPLATE2 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \
{ \
return FUNCTION(a(), b(), c); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
{ \
return FUNCTION(a(), b(), c); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\
{ \
return FUNCTION(a(), b, c); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
{ \
return FUNCTION(a, b(), c); \
}
@ -640,6 +649,22 @@ namespace glm
struct { glm::detail::swizzle<4,T,P,0,2,3,1> E0 ## E2 ## E3 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,0,2,3,2> E0 ## E2 ## E3 ## E2; }; \
struct { glm::detail::swizzle<4,T,P,0,2,3,3> E0 ## E2 ## E3 ## E3; }; \
struct { glm::detail::swizzle<4,T,P,0,3,0,0> E0 ## E3 ## E0 ## E0; }; \
struct { glm::detail::swizzle<4,T,P,0,3,0,1> E0 ## E3 ## E0 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,0,3,0,2> E0 ## E3 ## E0 ## E2; }; \
struct { glm::detail::swizzle<4,T,P,0,3,0,3> E0 ## E3 ## E0 ## E3; }; \
struct { glm::detail::swizzle<4,T,P,0,3,1,0> E0 ## E3 ## E1 ## E0; }; \
struct { glm::detail::swizzle<4,T,P,0,3,1,1> E0 ## E3 ## E1 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,0,3,1,2> E0 ## E3 ## E1 ## E2; }; \
struct { glm::detail::swizzle<4,T,P,0,3,1,3> E0 ## E3 ## E1 ## E3; }; \
struct { glm::detail::swizzle<4,T,P,0,3,2,0> E0 ## E3 ## E2 ## E0; }; \
struct { glm::detail::swizzle<4,T,P,0,3,2,1> E0 ## E3 ## E2 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,0,3,2,2> E0 ## E3 ## E2 ## E2; }; \
struct { glm::detail::swizzle<4,T,P,0,3,2,3> E0 ## E3 ## E2 ## E3; }; \
struct { glm::detail::swizzle<4,T,P,0,3,3,0> E0 ## E3 ## E3 ## E0; }; \
struct { glm::detail::swizzle<4,T,P,0,3,3,1> E0 ## E3 ## E3 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,0,3,3,2> E0 ## E3 ## E3 ## E2; }; \
struct { glm::detail::swizzle<4,T,P,0,3,3,3> E0 ## E3 ## E3 ## E3; }; \
struct { glm::detail::swizzle<4,T,P,1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
struct { glm::detail::swizzle<4,T,P,1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
struct { glm::detail::swizzle<4,T,P,1,0,0,2> E1 ## E0 ## E0 ## E2; }; \

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -50,7 +50,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType abs(genType const & x);
GLM_FUNC_DECL genType abs(genType const & x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
@ -59,7 +59,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType sign(genType const & x);
GLM_FUNC_DECL genType sign(genType const & x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
@ -68,7 +68,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType floor(genType const & x);
GLM_FUNC_DECL genType floor(genType const & x);
/// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x.
@ -78,7 +78,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType trunc(genType const & x);
GLM_FUNC_DECL genType trunc(genType const & x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
@ -91,7 +91,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType round(genType const & x);
GLM_FUNC_DECL genType round(genType const & x);
/// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even
@ -103,7 +103,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template <typename genType>
genType roundEven(genType const & x);
GLM_FUNC_DECL genType roundEven(genType const & x);
/// Returns a value equal to the nearest integer
/// that is greater than or equal to x.
@ -113,7 +113,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType ceil(genType const & x);
GLM_FUNC_DECL genType ceil(genType const & x);
/// Return x - floor(x).
///
@ -122,7 +122,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType fract(genType const & x);
GLM_FUNC_DECL genType fract(genType const & x);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
@ -132,7 +132,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType mod(
GLM_FUNC_DECL genType mod(
genType const & x,
genType const & y);
@ -144,7 +144,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType mod(
GLM_FUNC_DECL genType mod(
genType const & x,
typename genType::value_type const & y);
@ -158,7 +158,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType modf(
GLM_FUNC_DECL genType modf(
genType const & x,
genType & i);
@ -169,12 +169,12 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType min(
GLM_FUNC_DECL genType min(
genType const & x,
genType const & y);
template <typename genType>
genType min(
GLM_FUNC_DECL genType min(
genType const & x,
typename genType::value_type const & y);
@ -185,12 +185,12 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType max(
GLM_FUNC_DECL genType max(
genType const & x,
genType const & y);
template <typename genType>
genType max(
GLM_FUNC_DECL genType max(
genType const & x,
typename genType::value_type const & y);
@ -202,33 +202,33 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType clamp(
GLM_FUNC_DECL genType clamp(
genType const & x,
genType const & minVal,
genType const & maxVal);
template <typename genType>
genType clamp(
GLM_FUNC_DECL genType clamp(
genType const & x,
typename genType::value_type const & minVal,
typename genType::value_type const & maxVal);
//! @return If genTypeU is a floating scalar or vector:
//! Returns x * (1.0 - a) + y * a, i.e., the linear blend of
//! x and y using the floating-point value a.
//! The value for a is not restricted to the range [0, 1].
//!
//! @return If genTypeU is a boolean scalar or vector:
//! Selects which vector each returned component comes
//! from. For a component of a that is false, the
//! corresponding component of x is returned. For a
//! component of a that is true, the corresponding
//! component of y is returned. Components of x and y that
//! are not selected are allowed to be invalid floating point
//! values and will have no effect on the results. Thus, this
//! provides different functionality than
//! genType mix(genType x, genType y, genType(a))
//! where a is a Boolean vector.
/// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
/// x and y using the floating-point value a.
/// The value for a is not restricted to the range [0, 1].
///
/// If genTypeU is a boolean scalar or vector:
/// Selects which vector each returned component comes
/// from. For a component of <a> that is false, the
/// corresponding component of x is returned. For a
/// component of a that is true, the corresponding
/// component of y is returned. Components of x and y that
/// are not selected are allowed to be invalid floating point
/// values and will have no effect on the results. Thus, this
/// provides different functionality than
/// genType mix(genType x, genType y, genType(a))
/// where a is a Boolean vector.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
@ -256,19 +256,19 @@ namespace glm
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template <typename genTypeT, typename genTypeU>
genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
GLM_FUNC_DECL genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
//! Returns 0.0 if x < edge, otherwise it returns 1.0.
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType step(
GLM_FUNC_DECL genType step(
genType const & edge,
genType const & x);
template <typename genType>
genType step(
GLM_FUNC_DECL genType step(
typename genType::value_type const & edge,
genType const & x);
@ -278,8 +278,8 @@ namespace glm
/// you would want a threshold function with a smooth
/// transition. This is equivalent to:
/// genType t;
/// t = clamp ((x edge0) / (edge1 edge0), 0, 1);
/// return t * t * (3 2 * t);
/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
/// return t * t * (3 - 2 * t);
/// Results are undefined if edge0 >= edge1.
///
/// @tparam genType Floating-point scalar or vector types.
@ -287,13 +287,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType smoothstep(
GLM_FUNC_DECL genType smoothstep(
genType const & edge0,
genType const & edge1,
genType const & x);
template <typename genType>
genType smoothstep(
GLM_FUNC_DECL genType smoothstep(
typename genType::value_type const & edge0,
typename genType::value_type const & edge1,
genType const & x);
@ -311,7 +311,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
typename genType::bool_type isnan(genType const & x);
GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@ -324,7 +324,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
typename genType::bool_type isinf(genType const & x);
GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint
@ -336,7 +336,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType>
genIType floatBitsToInt(genType const & value);
GLM_FUNC_DECL genIType floatBitsToInt(genType const & value);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
@ -348,7 +348,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genUType>
genUType floatBitsToUint(genType const & value);
GLM_FUNC_DECL genUType floatBitsToUint(genType const & value);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
@ -364,7 +364,7 @@ namespace glm
///
/// @todo Clarify this declaration, we don't need to actually specify the return type
template <typename genType, typename genIType>
genType intBitsToFloat(genIType const & value);
GLM_FUNC_DECL genType intBitsToFloat(genIType const & value);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
@ -380,7 +380,7 @@ namespace glm
///
/// @todo Clarify this declaration, we don't need to actually specify the return type
template <typename genType, typename genUType>
genType uintBitsToFloat(genUType const & value);
GLM_FUNC_DECL genType uintBitsToFloat(genUType const & value);
/// Computes and returns a * b + c.
///
@ -389,7 +389,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
genType fma(genType const & a, genType const & b, genType const & c);
GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c);
/// Splits x into a floating-point significand in the range
/// [0.5, 1.0) and an integral exponent of two, such that:
@ -406,7 +406,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType>
genType frexp(genType const & x, genIType & exp);
GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp);
/// Builds a floating-point number from x and the
/// corresponding integral exponent of two in exp, returning:
@ -420,7 +420,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType>
genType ldexp(genType const & x, genIType const & exp);
GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -36,7 +36,7 @@ namespace detail
template <typename genFIType>
struct Abs_<genFIType, true>
{
static genFIType get(genFIType const & x)
GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
detail::type<genFIType>::is_float ||
@ -49,7 +49,7 @@ namespace detail
template <typename genFIType>
struct Abs_<genFIType, false>
{
static genFIType get(genFIType const & x)
GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
detail::type<genFIType>::is_uint, "'abs' only accept floating-point and integer inputs");
@ -275,7 +275,7 @@ namespace detail
//// Only valid if (INT_MIN <= x-y <= INT_MAX)
//// min(x,y)
//r = y + ((x - y) & ((x - y) >> (sizeof(int) *
//CHAR_BIT 1)));
//CHAR_BIT - 1)));
//// max(x,y)
//r = x - ((x - y) & ((x - y) >> (sizeof(int) *
//CHAR_BIT - 1)));
@ -420,93 +420,87 @@ namespace detail
}
// mix
template <typename genTypeT, typename genTypeU>
GLM_FUNC_QUALIFIER genTypeT mix
template <typename genType>
GLM_FUNC_QUALIFIER genType mix
(
genTypeT const & x,
genTypeT const & y,
genTypeU const & a
genType const & x,
genType const & y,
genType const & a
)
{
// It could be a vector too
//GLM_STATIC_ASSERT(
// detail::type<genTypeT>::is_float &&
// detail::type<genTypeU>::is_float);
GLM_STATIC_ASSERT(detail::type<genType>::is_float , "'genType' is not floating-point type");
//return x + a * (y - x);
return genTypeT(genTypeU(x) + a * genTypeU(y - x));
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec2<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<valType> mix
(
detail::tvec2<valTypeA> const & x,
detail::tvec2<valTypeA> const & y,
valTypeB const & a
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
valType const & a
)
{
return detail::tvec2<valTypeA>(
detail::tvec2<valTypeB>(x) + a * detail::tvec2<valTypeB>(y - x));
GLM_STATIC_ASSERT(detail::type<valType>::is_float , "'genType' is not floating-point type");
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec3<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<valType> mix
(
detail::tvec3<valTypeA> const & x,
detail::tvec3<valTypeA> const & y,
valTypeB const & a
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
valType const & a
)
{
return detail::tvec3<valTypeA>(
detail::tvec3<valTypeB>(x) + a * detail::tvec3<valTypeB>(y - x));
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec4<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<valType> mix
(
detail::tvec4<valTypeA> const & x,
detail::tvec4<valTypeA> const & y,
valTypeB const & a
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
valType const & a
)
{
return detail::tvec4<valTypeA>(
detail::tvec4<valTypeB>(x) + a * detail::tvec4<valTypeB>(y - x));
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec2<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<valType> mix
(
detail::tvec2<valTypeA> const & x,
detail::tvec2<valTypeA> const & y,
detail::tvec2<valTypeB> const & a
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
detail::tvec2<valType> const & a
)
{
return detail::tvec2<valTypeA>(
detail::tvec2<valTypeB>(x) + a * detail::tvec2<valTypeB>(y - x));
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec3<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<valType> mix
(
detail::tvec3<valTypeA> const & x,
detail::tvec3<valTypeA> const & y,
detail::tvec3<valTypeB> const & a
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
detail::tvec3<valType> const & a
)
{
return detail::tvec3<valTypeA>(
detail::tvec3<valTypeB>(x) + a * detail::tvec3<valTypeB>(y - x));
GLM_STATIC_ASSERT(detail::type<valType>::is_float , "'genType' is not floating-point type");
return x + a * (y - x);
}
template <typename valTypeA, typename valTypeB>
GLM_FUNC_QUALIFIER detail::tvec4<valTypeA> mix
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<valType> mix
(
detail::tvec4<valTypeA> const & x,
detail::tvec4<valTypeA> const & y,
detail::tvec4<valTypeB> const & a
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
detail::tvec4<valType> const & a
)
{
return detail::tvec4<valTypeA>(
detail::tvec4<valTypeB>(x) + a * detail::tvec4<valTypeB>(y - x));
return x + a * (y - x);
}
//template <typename genTypeT>
@ -525,15 +519,63 @@ namespace detail
// return x + a * (y - x);
//}
template <typename genType>
GLM_FUNC_QUALIFIER genType mix
template <>
GLM_FUNC_QUALIFIER float mix
(
genType const & x,
genType const & y,
float const & x,
float const & y,
bool const & a
)
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'mix' only accept floating-point inputs");
return a ? y : x;
}
template <>
GLM_FUNC_QUALIFIER double mix
(
double const & x,
double const & y,
bool const & a
)
{
return a ? y : x;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T> mix
(
detail::tvec2<T> const & x,
detail::tvec2<T> const & y,
bool a
)
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'mix' only accept floating-point inputs");
return a ? y : x;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> mix
(
detail::tvec3<T> const & x,
detail::tvec3<T> const & y,
bool a
)
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'mix' only accept floating-point inputs");
return a ? y : x;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T> mix
(
detail::tvec4<T> const & x,
detail::tvec4<T> const & y,
bool a
)
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'mix' only accept floating-point inputs");
return a ? y : x;
}
@ -552,8 +594,7 @@ namespace detail
for
(
typename detail::tvec2<T>::size_type i = 0;
i < detail::tvec2<T>::value_size();
++i
i < x.length(); ++i
)
{
result[i] = a[i] ? y[i] : x[i];
@ -575,8 +616,7 @@ namespace detail
for
(
typename detail::tvec3<T>::size_type i = 0;
i < detail::tvec3<T>::value_size();
++i
i < x.length(); ++i
)
{
result[i] = a[i] ? y[i] : x[i];
@ -598,8 +638,7 @@ namespace detail
for
(
typename detail::tvec4<T>::size_type i = 0;
i < detail::tvec4<T>::value_size();
++i
i < x.length(); ++i
)
{
result[i] = a[i] ? y[i] : x[i];
@ -803,17 +842,19 @@ namespace detail
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isnan' only accept floating-point inputs");
# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL))
# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL))
return _isnan(x) != 0;
# elif(GLM_COMPILER & GLM_COMPILER_GCC)
# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG))
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
return _isnan(x) != 0;
# else
return std::isnan(x);
# endif
# else
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
return isnan(x) != 0;
# else
return std::isnan(x);
# endif
# endif
}
template <typename T>
@ -858,32 +899,20 @@ namespace detail
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isinf' only accept floating-point inputs");
# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC))
# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC))
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
# elif(GLM_COMPILER & GLM_COMPILER_GCC)
# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG))
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
return _isinf(x) != 0;
# else
return std::isinf(x);
# endif
# else
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
// http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab
return isinf(double(x)) != 0;
# else
return std::isinf(x);
# endif
/*
# if(GLM_COMPILER & GLM_COMPILER_VC)
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
# elif(GLM_COMPILER & GLM_COMPILER_GCC)
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
return _isinf(x) != 0;
# else
return std::isinf(x);
# endif
# elif(GLM_COMPILER & GLM_COMPILER_INTEL)
return isinf(x) != 0;
# else
return std::isinf(x);
# endif
*/
# endif
}
template <typename T>

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -41,16 +41,16 @@ namespace glm
/// @addtogroup core_func_exponential
/// @{
/// Returns x raised to the y power.
/// Returns 'base' raised to the power 'exponent'.
///
/// @param x pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @param y
/// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @param exponent Floating point value representing the 'exponent'.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType pow(genType const & x, genType const & y);
GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent);
/// Returns the natural exponentiation of x, i.e., e^x.
///
@ -60,7 +60,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType exp(genType const & x);
GLM_FUNC_DECL genType exp(genType const & x);
/// Returns the natural logarithm of x, i.e.,
/// returns the value y which satisfies the equation x = e^y.
@ -72,7 +72,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType log(genType const & x);
GLM_FUNC_DECL genType log(genType const & x);
/// Returns 2 raised to the x power.
///
@ -82,7 +82,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType exp2(genType const & x);
GLM_FUNC_DECL genType exp2(genType const & x);
/// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y.
@ -93,7 +93,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType log2(genType const & x);
GLM_FUNC_DECL genType log2(genType const & x);
/// Returns the positive square root of x.
///
@ -103,7 +103,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType sqrt(genType const & x);
GLM_FUNC_DECL genType sqrt(genType const & x);
/// Returns the reciprocal of the positive square root of x.
///
@ -113,7 +113,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
genType inversesqrt(genType const & x);
GLM_FUNC_DECL genType inversesqrt(genType const & x);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -146,6 +146,7 @@ namespace _detail
)
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'inversesqrt' only accept floating-point input");
assert(x > genType(0));
return genType(1) / ::std::sqrt(x);
}

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -48,7 +48,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
typename genType::value_type length(
GLM_FUNC_DECL typename genType::value_type length(
genType const & x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
@ -58,7 +58,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
typename genType::value_type distance(
GLM_FUNC_DECL typename genType::value_type distance(
genType const & p0,
genType const & p1);
@ -69,7 +69,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
typename genType::value_type dot(
GLM_FUNC_DECL typename genType::value_type dot(
genType const & x,
genType const & y);
@ -80,7 +80,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename valType>
detail::tvec3<valType> cross(
GLM_FUNC_DECL detail::tvec3<valType> cross(
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y);
@ -89,7 +89,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
genType normalize(
GLM_FUNC_DECL genType normalize(
genType const & x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
@ -99,7 +99,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
genType faceforward(
GLM_FUNC_DECL genType faceforward(
genType const & N,
genType const & I,
genType const & Nref);
@ -112,7 +112,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
genType reflect(
GLM_FUNC_DECL genType reflect(
genType const & I,
genType const & N);
@ -125,7 +125,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
genType refract(
GLM_FUNC_DECL genType refract(
genType const & I,
genType const & N,
typename genType::value_type const & eta);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -132,7 +132,6 @@ namespace glm
(
genType const & x,
genType const & y
)
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'dot' only accept floating-point inputs");
@ -271,7 +270,7 @@ namespace glm
// reflect
template <typename genType>
genType reflect
GLM_FUNC_QUALIFIER genType reflect
(
genType const & I,
genType const & N

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -52,7 +52,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
genUType uaddCarry(
GLM_FUNC_DECL genUType uaddCarry(
genUType const & x,
genUType const & y,
genUType & carry);
@ -66,7 +66,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
genUType usubBorrow(
GLM_FUNC_DECL genUType usubBorrow(
genUType const & x,
genUType const & y,
genUType & borrow);
@ -80,7 +80,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
void umulExtended(
GLM_FUNC_DECL void umulExtended(
genUType const & x,
genUType const & y,
genUType & msb,
@ -95,7 +95,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIType>
void imulExtended(
GLM_FUNC_DECL void imulExtended(
genIType const & x,
genIType const & y,
genIType & msb,
@ -105,7 +105,7 @@ namespace glm
/// returning them in the least significant bits of the result.
/// For unsigned data types, the most significant bits of the
/// result will be set to zero. For signed data types, the
/// most significant bits will be set to the value of bit offset + base 1.
/// most significant bits will be set to the value of bit offset + base - 1.
///
/// If bits is zero, the result will be zero. The result will be
/// undefined if offset or bits is negative, or if the sum of
@ -117,7 +117,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
genIUType bitfieldExtract(
GLM_FUNC_DECL genIUType bitfieldExtract(
genIUType const & Value,
int const & Offset,
int const & Bits);
@ -125,7 +125,7 @@ namespace glm
/// Returns the insertion the bits least-significant bits of insert into base.
///
/// The result will have bits [offset, offset + bits - 1] taken
/// from bits [0, bits 1] of insert, and all other bits taken
/// from bits [0, bits - 1] of insert, and all other bits taken
/// directly from the corresponding bits of base. If bits is
/// zero, the result will simply be base. The result will be
/// undefined if offset or bits is negative, or if the sum of
@ -137,7 +137,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
genIUType bitfieldInsert(
GLM_FUNC_DECL genIUType bitfieldInsert(
genIUType const & Base,
genIUType const & Insert,
int const & Offset,
@ -152,7 +152,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
genIUType bitfieldReverse(genIUType const & Value);
GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value);
/// Returns the number of bits set to 1 in the binary representation of value.
///
@ -163,7 +163,7 @@ namespace glm
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
GLM_FUNC_DECL typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
@ -176,7 +176,7 @@ namespace glm
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
GLM_FUNC_DECL typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
/// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
@ -190,7 +190,7 @@ namespace glm
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
GLM_FUNC_DECL typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -26,10 +26,12 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#if(GLM_ARCH != GLM_ARCH_PURE)
#if(GLM_COMPILER & GLM_COMPILER_VC)
#include <intrin.h>
#pragma intrinsic(_BitScanReverse)
#endif
# include <intrin.h>
# pragma intrinsic(_BitScanReverse)
#endif//(GLM_COMPILER & GLM_COMPILER_VC)
#endif//(GLM_ARCH != GLM_ARCH_PURE)
namespace glm
{
@ -103,7 +105,7 @@ namespace glm
if(x > y)
return genUType(detail::highp_int_t(x) - detail::highp_int_t(y));
else
return genUType(detail::highp_int_t(1) << detail::highp_int_t(32) + detail::highp_int_t(x) - detail::highp_int_t(y));
return genUType((detail::highp_int_t(1) << detail::highp_int_t(32)) + detail::highp_int_t(x) - detail::highp_int_t(y));
}
template <typename T>
@ -521,7 +523,6 @@ namespace glm
}
// findMSB
/*
#if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC))
template <typename genIUType>
@ -538,7 +539,7 @@ namespace glm
_BitScanReverse(&Result, Value);
return int(Result);
}
/*
// __builtin_clz seems to be buggy as it crasks for some values, from 0x00200000 to 80000000
#elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40))
@ -560,8 +561,9 @@ namespace glm
//
return 31 - __builtin_clzl(Value);
}
#else
*/
#else
/* SSE implementation idea
__m128i const Zero = _mm_set_epi32( 0, 0, 0, 0);
@ -606,7 +608,7 @@ namespace glm
return MostSignificantBit;
}
}
//#endif//(GLM_COMPILER)
#endif//(GLM_COMPILER)
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<int> findMSB

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -53,7 +53,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename matType>
matType matrixCompMult(
GLM_FUNC_DECL matType matrixCompMult(
matType const & x,
matType const & y);
@ -68,7 +68,7 @@ namespace glm
///
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
template <typename vecType, typename matType>
matType outerProduct(
GLM_FUNC_DECL matType outerProduct(
vecType const & c,
vecType const & r);
@ -79,7 +79,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename matType>
typename matType::transpose_type transpose(
GLM_FUNC_DECL typename matType::transpose_type transpose(
matType const & x);
/// Return the determinant of a mat2 matrix.
@ -89,7 +89,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
typename detail::tmat2x2<valType>::value_type determinant(
GLM_FUNC_DECL typename detail::tmat2x2<valType>::value_type determinant(
detail::tmat2x2<valType> const & m);
/// Return the determinant of a mat3 matrix.
@ -99,7 +99,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
typename detail::tmat3x3<valType>::value_type determinant(
GLM_FUNC_DECL typename detail::tmat3x3<valType>::value_type determinant(
detail::tmat3x3<valType> const & m);
/// Return the determinant of a mat4 matrix.
@ -109,7 +109,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
typename detail::tmat4x4<valType>::value_type determinant(
GLM_FUNC_DECL typename detail::tmat4x4<valType>::value_type determinant(
detail::tmat4x4<valType> const & m);
/// Return the inverse of a mat2 matrix.
@ -119,7 +119,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
detail::tmat2x2<valType> inverse(
GLM_FUNC_DECL detail::tmat2x2<valType> inverse(
detail::tmat2x2<valType> const & m);
/// Return the inverse of a mat3 matrix.
@ -129,7 +129,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
detail::tmat3x3<valType> inverse(
GLM_FUNC_DECL detail::tmat3x3<valType> inverse(
detail::tmat3x3<valType> const & m);
/// Return the inverse of a mat4 matrix.
@ -139,7 +139,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename valType>
detail::tmat4x4<valType> inverse(
GLM_FUNC_DECL detail::tmat4x4<valType> inverse(
detail::tmat4x4<valType> const & m);
/// @}

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -50,7 +50,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
typename genType::value_type noise1(genType const & x);
GLM_FUNC_DECL typename genType::value_type noise1(genType const & x);
/// Returns a 2D noise value based on the input value x.
///
@ -59,7 +59,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
detail::tvec2<typename genType::value_type> noise2(genType const & x);
GLM_FUNC_DECL detail::tvec2<typename genType::value_type> noise2(genType const & x);
/// Returns a 3D noise value based on the input value x.
///
@ -68,7 +68,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
detail::tvec3<typename genType::value_type> noise3(genType const & x);
GLM_FUNC_DECL detail::tvec3<typename genType::value_type> noise3(genType const & x);
/// Returns a 4D noise value based on the input value x.
///
@ -77,7 +77,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
detail::tvec4<typename genType::value_type> noise4(genType const & x);
GLM_FUNC_DECL detail::tvec4<typename genType::value_type> noise4(genType const & x);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -52,7 +52,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::uint32 packUnorm2x16(detail::tvec2<detail::float32> const & v);
GLM_FUNC_DECL detail::uint32 packUnorm2x16(detail::tvec2<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
@ -65,7 +65,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::uint32 packSnorm2x16(detail::tvec2<detail::float32> const & v);
GLM_FUNC_DECL detail::uint32 packSnorm2x16(detail::tvec2<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
@ -78,7 +78,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::uint32 packUnorm4x8(detail::tvec4<detail::float32> const & v);
GLM_FUNC_DECL detail::uint32 packUnorm4x8(detail::tvec4<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
@ -91,7 +91,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::uint32 packSnorm4x8(detail::tvec4<detail::float32> const & v);
GLM_FUNC_DECL detail::uint32 packSnorm4x8(detail::tvec4<detail::float32> const & v);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -104,7 +104,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<detail::float32> unpackUnorm2x16(detail::uint32 const & p);
GLM_FUNC_DECL detail::tvec2<detail::float32> unpackUnorm2x16(detail::uint32 const & p);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -117,7 +117,7 @@ namespace glm
//!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<detail::float32> unpackSnorm2x16(detail::uint32 const & p);
GLM_FUNC_DECL detail::tvec2<detail::float32> unpackSnorm2x16(detail::uint32 const & p);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -130,7 +130,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec4<detail::float32> unpackUnorm4x8(detail::uint32 const & p);
GLM_FUNC_DECL detail::tvec4<detail::float32> unpackUnorm4x8(detail::uint32 const & p);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -143,7 +143,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec4<detail::float32> unpackSnorm4x8(detail::uint32 const & p);
GLM_FUNC_DECL detail::tvec4<detail::float32> unpackSnorm4x8(detail::uint32 const & p);
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
@ -153,7 +153,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
double packDouble2x32(detail::tvec2<detail::uint32> const & v);
GLM_FUNC_DECL double packDouble2x32(detail::tvec2<detail::uint32> const & v);
/// Returns a two-component unsigned integer vector representation of v.
/// The bit-level representation of v is preserved.
@ -162,7 +162,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<detail::uint32> unpackDouble2x32(double const & v);
GLM_FUNC_DECL detail::tvec2<detail::uint32> unpackDouble2x32(double const & v);
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification,
@ -172,7 +172,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint packHalf2x16(vec2 const & v);
GLM_FUNC_DECL uint packHalf2x16(vec2 const & v);
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
@ -182,7 +182,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
vec2 unpackHalf2x16(uint const & v);
GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -136,12 +136,42 @@ namespace glm
GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2<detail::uint32> const & v)
{
return *(double*)&v;
struct uint32_pair
{
detail::uint32 x;
detail::uint32 y;
};
union helper
{
uint32_pair input;
double output;
} Helper;
Helper.input.x = v.x;
Helper.input.y = v.y;
return Helper.output;
//return *(double*)&v;
}
GLM_FUNC_QUALIFIER detail::tvec2<uint> unpackDouble2x32(double const & v)
{
return *(detail::tvec2<uint>*)&v;
struct uint32_pair
{
detail::uint32 x;
detail::uint32 y;
};
union helper
{
double input;
uint32_pair output;
} Helper;
Helper.input = v;
return detail::tvec2<uint>(Helper.output.x, Helper.output.y);
}
GLM_FUNC_QUALIFIER uint packHalf2x16(detail::tvec2<float> const & v)
@ -157,7 +187,7 @@ namespace glm
Pack.orig.a = detail::toFloat16(v.x);
Pack.orig.b = detail::toFloat16(v.y);
return *(uint*)&Pack;
return Pack.other;
}
GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v)

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -52,7 +52,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType radians(genType const & degrees);
GLM_FUNC_DECL genType radians(genType const & degrees);
/// Converts radians to degrees and returns the result.
///
@ -61,7 +61,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType degrees(genType const & radians);
GLM_FUNC_DECL genType degrees(genType const & radians);
/// The standard trigonometric sine function.
/// The values returned by this function will range from [-1, 1].
@ -71,7 +71,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType sin(genType const & angle);
GLM_FUNC_DECL genType sin(genType const & angle);
/// The standard trigonometric cosine function.
/// The values returned by this function will range from [-1, 1].
@ -81,7 +81,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType cos(genType const & angle);
GLM_FUNC_DECL genType cos(genType const & angle);
/// The standard trigonometric tangent function.
///
@ -90,7 +90,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType tan(genType const & angle);
GLM_FUNC_DECL genType tan(genType const & angle);
/// Arc sine. Returns an angle whose sine is x.
/// The range of values returned by this function is [-PI/2, PI/2].
@ -101,7 +101,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType asin(genType const & x);
GLM_FUNC_DECL genType asin(genType const & x);
/// Arc cosine. Returns an angle whose sine is x.
/// The range of values returned by this function is [0, PI].
@ -112,7 +112,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType acos(genType const & x);
GLM_FUNC_DECL genType acos(genType const & x);
/// Arc tangent. Returns an angle whose tangent is y/x.
/// The signs of x and y are used to determine what
@ -125,7 +125,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType atan(genType const & y, genType const & x);
GLM_FUNC_DECL genType atan(genType const & y, genType const & x);
/// Arc tangent. Returns an angle whose tangent is y_over_x.
/// The range of values returned by this function is [-PI/2, PI/2].
@ -135,7 +135,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType atan(genType const & y_over_x);
GLM_FUNC_DECL genType atan(genType const & y_over_x);
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
///
@ -144,7 +144,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType sinh(genType const & angle);
GLM_FUNC_DECL genType sinh(genType const & angle);
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
///
@ -153,7 +153,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType cosh(genType const & angle);
GLM_FUNC_DECL genType cosh(genType const & angle);
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
///
@ -162,7 +162,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType tanh(genType const & angle);
GLM_FUNC_DECL genType tanh(genType const & angle);
/// Arc hyperbolic sine; returns the inverse of sinh.
///
@ -171,7 +171,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType asinh(genType const & x);
GLM_FUNC_DECL genType asinh(genType const & x);
/// Arc hyperbolic cosine; returns the non-negative inverse
/// of cosh. Results are undefined if x < 1.
@ -181,7 +181,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType acosh(genType const & x);
GLM_FUNC_DECL genType acosh(genType const & x);
/// Arc hyperbolic tangent; returns the inverse of tanh.
/// Results are undefined if abs(x) >= 1.
@ -191,7 +191,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
genType atanh(genType const & x);
GLM_FUNC_DECL genType atanh(genType const & x);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -55,7 +55,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type lessThan(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type lessThan(vecType const & x, vecType const & y);
/// Returns the component-wise comparison of result x <= y.
///
@ -64,7 +64,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y);
/// Returns the component-wise comparison of result x > y.
///
@ -73,7 +73,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type greaterThan(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type greaterThan(vecType const & x, vecType const & y);
/// Returns the component-wise comparison of result x >= y.
///
@ -82,7 +82,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y);
/// Returns the component-wise comparison of result x == y.
///
@ -91,7 +91,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type equal(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type equal(vecType const & x, vecType const & y);
/// Returns the component-wise comparison of result x != y.
///
@ -100,7 +100,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <typename vecType>
typename vecType::bool_type notEqual(vecType const & x, vecType const & y);
GLM_FUNC_DECL typename vecType::bool_type notEqual(vecType const & x, vecType const & y);
/// Returns true if any component of x is true.
///
@ -109,7 +109,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <template <typename> class vecType>
bool any(vecType<bool> const & v);
GLM_FUNC_DECL bool any(vecType<bool> const & v);
/// Returns true if all components of x are true.
///
@ -118,7 +118,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <template <typename> class vecType>
bool all(vecType<bool> const & v);
GLM_FUNC_DECL bool all(vecType<bool> const & v);
/// Returns the component-wise logical complement of x.
/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
@ -128,7 +128,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <template <typename> class vecType>
vecType<bool> not_(vecType<bool> const & v);
GLM_FUNC_DECL vecType<bool> not_(vecType<bool> const & v);
/// @}
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -36,7 +36,7 @@
#define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 4
#define GLM_VERSION_REVISION 0
#define GLM_VERSION_REVISION 7
///////////////////////////////////////////////////////////////////////////////////////////////////
// Platform
@ -50,6 +50,7 @@
#define GLM_PLATFORM_CHROME_NACL 0x00200000
#define GLM_PLATFORM_UNIX 0x00400000
#define GLM_PLATFORM_QNXNTO 0x00800000
#define GLM_PLATFORM_WINCE 0x01000000
#ifdef GLM_FORCE_PLATFORM_UNKNOWN
# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
@ -57,6 +58,8 @@
# define GLM_PLATFORM GLM_PLATFORM_QNXNTO
#elif defined(__APPLE__)
# define GLM_PLATFORM GLM_PLATFORM_APPLE
#elif defined(WINCE)
# define GLM_PLATFORM GLM_PLATFORM_WINCE
#elif defined(_WIN32)
# define GLM_PLATFORM GLM_PLATFORM_WINDOWS
#elif defined(__native_client__)
@ -74,20 +77,24 @@
// Report platform detection
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED))
# define GLM_MESSAGE_PLATFORM_DISPLAYED
# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
# pragma message("GLM: Windows platform detected")
# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
# pragma message("GLM: QNX platform detected")
//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
//# pragma message("GLM: iOS platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
# pragma message("GLM: Apple platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
# pragma message("GLM: WinCE platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
# pragma message("GLM: Windows platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
# pragma message("GLM: Native Client detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
# pragma message("GLM: Android platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
# pragma message("GLM: Linux platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
# pragma message("GLM: UNIX platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
# pragma message("GLM: Android platform detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
# pragma message("GLM: Chrone Native Client detected")
# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
# pragma message("GLM: platform unknown")
# else
@ -103,6 +110,17 @@
#define GLM_COMPILER_UNKNOWN 0x00000000
// Intel
#define GLM_COMPILER_INTEL 0x00100000
#define GLM_COMPILER_INTEL9 0x00100010
#define GLM_COMPILER_INTEL10_0 0x00100020
#define GLM_COMPILER_INTEL10_1 0x00100030
#define GLM_COMPILER_INTEL11_0 0x00100040
#define GLM_COMPILER_INTEL11_1 0x00100050
#define GLM_COMPILER_INTEL12_0 0x00100060
#define GLM_COMPILER_INTEL12_1 0x00100070
#define GLM_COMPILER_INTEL13_0 0x00100080
// Visual C++ defines
#define GLM_COMPILER_VC 0x01000000
#define GLM_COMPILER_VC2 0x01000010
@ -115,6 +133,7 @@
#define GLM_COMPILER_VC2008 0x01000080
#define GLM_COMPILER_VC2010 0x01000090
#define GLM_COMPILER_VC2012 0x010000A0
#define GLM_COMPILER_VC2013 0x010000B0
// GCC defines
#define GLM_COMPILER_GCC 0x02000000
@ -136,7 +155,6 @@
#define GLM_COMPILER_GCC47 0x020000E0
#define GLM_COMPILER_GCC48 0x020000F0
#define GLM_COMPILER_GCC49 0x02000100
#define GLM_COMPILER_GCC50 0x02000200
// G++ command line to display defined
// echo "" | g++ -E -dM -x c++ - | sort
@ -179,17 +197,6 @@
// LLVM GCC
#define GLM_COMPILER_LLVM_GCC 0x40000000
// Intel
#define GLM_COMPILER_INTEL 0x80000000
#define GLM_COMPILER_INTEL9 0x80000010
#define GLM_COMPILER_INTEL10_0 0x80000020
#define GLM_COMPILER_INTEL10_1 0x80000030
#define GLM_COMPILER_INTEL11_0 0x80000040
#define GLM_COMPILER_INTEL11_1 0x80000050
#define GLM_COMPILER_INTEL12_0 0x80000060
#define GLM_COMPILER_INTEL12_1 0x80000070
#define GLM_COMPILER_INTEL13_0 0x80000080
// Build model
#define GLM_MODEL_32 0x00000010
#define GLM_MODEL_64 0x00000020
@ -213,7 +220,7 @@
# define GLM_COMPILER GLM_COMPILER_INTEL12_0
# elif __INTEL_COMPILER == 1210
# define GLM_COMPILER GLM_COMPILER_INTEL12_1
# elif __INTEL_COMPILER == 1300
# elif __INTEL_COMPILER >= 1300
# define GLM_COMPILER GLM_COMPILER_INTEL13_0
# else
# define GLM_COMPILER GLM_COMPILER_INTEL
@ -221,41 +228,16 @@
// CUDA
#elif defined(__CUDACC__)
# define GLM_COMPILER GLM_COMPILER_CUDA
/*
# if CUDA_VERSION < 3000
# error "GLM requires CUDA 3.0 or higher"
# elif CUDA_VERSION == 3000
# define GLM_COMPILER GLM_COMPILER_CUDA30
# elif CUDA_VERSION == 3010
# define GLM_COMPILER GLM_COMPILER_CUDA31
# elif CUDA_VERSION == 3020
# define GLM_COMPILER GLM_COMPILER_CUDA32
# elif CUDA_VERSION == 4000
# define GLM_COMPILER GLM_COMPILER_CUDA40
# elif CUDA_VERSION == 4010
# define GLM_COMPILER GLM_COMPILER_CUDA41
# elif CUDA_VERSION == 4020
# define GLM_COMPILER GLM_COMPILER_CUDA42
# else
# define GLM_COMPILER GLM_COMPILER_CUDA
# endif
*/
// Visual C++
#elif defined(_MSC_VER)
# if _MSC_VER == 900
# define GLM_COMPILER GLM_COMPILER_VC2
# elif _MSC_VER == 1000
# define GLM_COMPILER GLM_COMPILER_VC4
# elif _MSC_VER == 1100
# define GLM_COMPILER GLM_COMPILER_VC5
# elif _MSC_VER == 1200
# define GLM_COMPILER GLM_COMPILER_VC6
# elif _MSC_VER == 1300
# define GLM_COMPILER GLM_COMPILER_VC2002
# elif _MSC_VER == 1310
# define GLM_COMPILER GLM_COMPILER_VC2003
# if _MSC_VER < 1400
# error "GLM requires Visual C++ 2005 or higher"
# elif _MSC_VER == 1400
# define GLM_COMPILER GLM_COMPILER_VC2005
# elif _MSC_VER == 1500
@ -264,13 +246,17 @@
# define GLM_COMPILER GLM_COMPILER_VC2010
# elif _MSC_VER == 1700
# define GLM_COMPILER GLM_COMPILER_VC2012
# elif _MSC_VER >= 1800
# define GLM_COMPILER GLM_COMPILER_VC2013
# else//_MSC_VER
# define GLM_COMPILER GLM_COMPILER_VC
# endif//_MSC_VER
// Clang
#elif defined(__clang__)
# if(__clang_major__ == 2) && (__clang_minor__ == 6)
# if (__clang_major__ <= 1) || ((__clang_major__ == 2) && (__clang_minor__ < 6))
# error "GLM requires Clang 2.6 or higher"
# elif(__clang_major__ == 2) && (__clang_minor__ == 6)
# define GLM_COMPILER GLM_COMPILER_CLANG26
# elif(__clang_major__ == 2) && (__clang_minor__ == 7)
# define GLM_COMPILER GLM_COMPILER_CLANG27
@ -292,7 +278,9 @@
# define GLM_COMPILER GLM_COMPILER_CLANG41
# elif(__clang_major__ == 4) && (__clang_minor__ == 2)
# define GLM_COMPILER GLM_COMPILER_CLANG42
# elif(__clang_major__ == 4) && (__clang_minor__ == 3)
# elif(__clang_major__ == 4) && (__clang_minor__ >= 3)
# define GLM_COMPILER GLM_COMPILER_CLANG43
# elif(__clang_major__ > 4)
# define GLM_COMPILER GLM_COMPILER_CLANG43
# else
# define GLM_COMPILER GLM_COMPILER_CLANG
@ -326,27 +314,17 @@
# define GLM_COMPILER (GLM_COMPILER_GCC47)
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
# define GLM_COMPILER (GLM_COMPILER_GCC48)
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9)
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)
# define GLM_COMPILER (GLM_COMPILER_GCC49)
# elif (__GNUC__ > 4 )
# define GLM_COMPILER (GLM_COMPILER_GCC49)
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
# define GLM_COMPILER (GLM_COMPILER_GCC50)
# else
# define GLM_COMPILER (GLM_COMPILER_GCC)
# endif
// Borland C++
#elif defined(_BORLANDC_)
# if defined(VER125)
# define GLM_COMPILER GLM_COMPILER_BCB4
# elif defined(VER130)
# define GLM_COMPILER GLM_COMPILER_BCB5
# elif defined(VER140)
# define GLM_COMPILER GLM_COMPILER_BCB6
# elif defined(VER200)
# define GLM_COMPILER GLM_COMPILER_BCB2009
# else
# define GLM_COMPILER GLM_COMPILER_BC
# endif
# define GLM_COMPILER GLM_COMPILER_BC
// Codewarrior
#elif defined(__MWERKS__)
@ -432,9 +410,27 @@
#elif(defined(GLM_FORCE_CXX98))
# define GLM_LANG GLM_LANG_CXX98
#else
// -std=c++0x or -std=gnu++0x
# if(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# define GLM_LANG GLM_LANG_CXX0X
# if(__cplusplus >= 201103L)
# define GLM_LANG GLM_LANG_CXX11
# elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
# if(GLM_PLATFORM == GLM_PLATFORM_APPLE)
# define GLM_DETAIL_MAJOR 1
# else
# define GLM_DETAIL_MAJOR 0
# endif
# if(__clang_major__ < (2 + GLM_DETAIL_MAJOR))
# define GLM_LANG GLM_LANG_CXX
# elif(__has_feature(cxx_auto_type))
# define GLM_LANG GLM_LANG_CXX0X
# else
# define GLM_LANG GLM_LANG_CXX98
# endif
# elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define GLM_LANG GLM_LANG_CXX0X
# else
# define GLM_LANG GLM_LANG_CXX98
# endif
# elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS))
# define GLM_LANG GLM_LANG_CXXMS
# elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS))
@ -442,10 +438,8 @@
# define GLM_LANG GLM_LANG_CXX0X
# else
# define GLM_LANG GLM_LANG_CXX98
# endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
# elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) //&& defined(__STRICT_ANSI__))
# define GLM_LANG GLM_LANG_CXX98
# elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
# endif
# elif(__cplusplus >= 199711L)
# define GLM_LANG GLM_LANG_CXX98
# else
# define GLM_LANG GLM_LANG_CXX
@ -496,7 +490,9 @@
#elif(defined(GLM_FORCE_SSE2))
# define GLM_ARCH (GLM_ARCH_SSE2)
#elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64)))
# if(defined(_M_CEE_PURE))
# if(GLM_PLATFORM == GLM_PLATFORM_WINCE)
# define GLM_ARCH GLM_ARCH_PURE
# elif(defined(_M_CEE_PURE))
# define GLM_ARCH GLM_ARCH_PURE
/* TODO: Explore auto detection of instruction set support
# elif(defined(_M_IX86_FP))
@ -649,29 +645,31 @@
// User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA
#if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA))
# define GLM_CUDA_FUNC_DEF __device__ __host__
# define GLM_CUDA_FUNC_DEF __device__ __host__
# define GLM_CUDA_FUNC_DECL __device__ __host__
#else
# define GLM_CUDA_FUNC_DEF
# define GLM_CUDA_FUNC_DEF
# define GLM_CUDA_FUNC_DECL
#endif
#if GLM_COMPILER & GLM_COMPILER_GCC
#define GLM_VAR_USED __attribute__ ((unused))
# define GLM_VAR_USED __attribute__ ((unused))
#else
#define GLM_VAR_USED
# define GLM_VAR_USED
#endif
#if(defined(GLM_FORCE_INLINE))
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
# define GLM_INLINE __forceinline
# elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
# define GLM_INLINE __attribute__((always_inline))
# else
# define GLM_INLINE inline
# endif//GLM_COMPILER
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
# define GLM_INLINE __forceinline
# elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
# define GLM_INLINE __attribute__((always_inline))
# elif(GLM_COMPILER & GLM_COMPILER_CLANG)
# define GLM_INLINE __attribute__((always_inline))
# else
# define GLM_INLINE inline
# endif//GLM_COMPILER
#else
# define GLM_INLINE inline
# define GLM_INLINE inline
#endif//defined(GLM_FORCE_INLINE)
#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -36,8 +36,8 @@ namespace detail
{
typedef short hdata;
float toFloat32(hdata value);
hdata toFloat16(float const & value);
GLM_FUNC_DECL float toFloat32(hdata value);
GLM_FUNC_DECL hdata toFloat16(float const & value);
class half
{
@ -71,42 +71,42 @@ namespace detail
hdata data;
};
half operator+ (half const & s1, half const & s2);
GLM_FUNC_DECL half operator+ (half const & s1, half const & s2);
half operator- (half const & s1, half const & s2);
GLM_FUNC_DECL half operator- (half const & s1, half const & s2);
half operator* (half const & s1, half const & s2);
GLM_FUNC_DECL half operator* (half const & s1, half const & s2);
half operator/ (half const & s1, half const & s2);
GLM_FUNC_DECL half operator/ (half const & s1, half const & s2);
// Unary constant operators
half operator- (half const & s);
GLM_FUNC_DECL half operator- (half const & s);
half operator-- (half const & s, int);
GLM_FUNC_DECL half operator-- (half const & s, int);
half operator++ (half const & s, int);
GLM_FUNC_DECL half operator++ (half const & s, int);
bool operator==(
GLM_FUNC_DECL bool operator==(
detail::half const & x,
detail::half const & y);
bool operator!=(
GLM_FUNC_DECL bool operator!=(
detail::half const & x,
detail::half const & y);
bool operator<(
GLM_FUNC_DECL bool operator<(
detail::half const & x,
detail::half const & y);
bool operator<=(
GLM_FUNC_DECL bool operator<=(
detail::half const & x,
detail::half const & y);
bool operator>(
GLM_FUNC_DECL bool operator>(
detail::half const & x,
detail::half const & y);
bool operator>=(
GLM_FUNC_DECL bool operator>=(
detail::half const & x,
detail::half const & y);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
///
/// This half implementation is based on OpenEXR which is Copyright (c) 2002,
/// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
@ -135,9 +135,9 @@ namespace detail
// of float and half (127 versus 15).
//
register int s = (i >> 16) & 0x00008000;
register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
register int m = i & 0x007fffff;
int s = (i >> 16) & 0x00008000;
int e = ((i >> 23) & 0x000000ff) - (127 - 15);
int m = i & 0x007fffff;
//
// Now reassemble s, e and m into a half:

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -47,13 +47,19 @@ namespace detail
GLM_DETAIL_IS_INT(signed short);
GLM_DETAIL_IS_INT(signed int);
GLM_DETAIL_IS_INT(signed long);
GLM_DETAIL_IS_INT(highp_int_t);
GLM_DETAIL_IS_UINT(unsigned char);
GLM_DETAIL_IS_UINT(unsigned short);
GLM_DETAIL_IS_UINT(unsigned int);
GLM_DETAIL_IS_UINT(unsigned long);
#if(GLM_LANG >= GLM_LANG_CXX0X)
GLM_DETAIL_IS_INT(signed long long);
GLM_DETAIL_IS_UINT(unsigned long long);
#else
GLM_DETAIL_IS_INT(highp_int_t);
GLM_DETAIL_IS_UINT(highp_uint_t);
#endif
}//namespace detail
/// @addtogroup core_precision

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -34,40 +34,6 @@
namespace glm{
namespace detail
{
//template
//<
// typename T,
// template <typename> class C,
// template <typename> class R
//>
//struct matType
//{
// enum ctor{null};
// typedef T value_type;
// typedef std::size_t size_type;
// typedef C<T> col_type;
// typedef R<T> row_type;
// static size_type const col_size;
// static size_type const row_size;
//};
//template
//<
// typename T,
// template <typename> class C,
// template <typename> class R
//>
//typename matType<T, C, R>::size_type const
//matType<T, C, R>::col_size = matType<T, C, R>::col_type::value_size;
//template
//<
// typename T,
// template <typename> class C,
// template <typename> class R
//>
//typename matType<T, C, R>::size_type const
//matType<T, C, R>::row_size = matType<T, C, R>::row_type::value_size;
}//namespace detail
}//namespace glm

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -133,19 +133,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator+=(U const & s);
GLM_FUNC_DECL tmat2x2<T> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator+=(tmat2x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator-=(U const & s);
GLM_FUNC_DECL tmat2x2<T> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator-=(tmat2x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator*=(U const & s);
GLM_FUNC_DECL tmat2x2<T> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator*=(tmat2x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator/=(U const & s);
GLM_FUNC_DECL tmat2x2<T> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T> & operator/=(tmat2x2<U> const & m);
GLM_FUNC_DECL tmat2x2<T> & operator++();
@ -154,107 +154,107 @@ namespace detail
// Binary operators
template <typename T>
tmat2x2<T> operator+ (
GLM_FUNC_DECL tmat2x2<T> operator+ (
tmat2x2<T> const & m,
typename tmat2x2<T>::value_type const & s);
template <typename T>
tmat2x2<T> operator+ (
GLM_FUNC_DECL tmat2x2<T> operator+ (
typename tmat2x2<T>::value_type const & s,
tmat2x2<T> const & m);
template <typename T>
tmat2x2<T> operator+ (
GLM_FUNC_DECL tmat2x2<T> operator+ (
tmat2x2<T> const & m1,
tmat2x2<T> const & m2);
template <typename T>
tmat2x2<T> operator- (
GLM_FUNC_DECL tmat2x2<T> operator- (
tmat2x2<T> const & m,
typename tmat2x2<T>::value_type const & s);
template <typename T>
tmat2x2<T> operator- (
GLM_FUNC_DECL tmat2x2<T> operator- (
typename tmat2x2<T>::value_type const & s,
tmat2x2<T> const & m);
template <typename T>
tmat2x2<T> operator- (
GLM_FUNC_DECL tmat2x2<T> operator- (
tmat2x2<T> const & m1,
tmat2x2<T> const & m2);
template <typename T>
tmat2x2<T> operator* (
GLM_FUNC_DECL tmat2x2<T> operator* (
tmat2x2<T> const & m,
typename tmat2x2<T>::value_type const & s);
template <typename T>
tmat2x2<T> operator* (
GLM_FUNC_DECL tmat2x2<T> operator* (
typename tmat2x2<T>::value_type const & s,
tmat2x2<T> const & m);
template <typename T>
typename tmat2x2<T>::col_type operator* (
GLM_FUNC_DECL typename tmat2x2<T>::col_type operator* (
tmat2x2<T> const & m,
typename tmat2x2<T>::row_type const & v);
template <typename T>
typename tmat2x2<T>::row_type operator* (
GLM_FUNC_DECL typename tmat2x2<T>::row_type operator* (
typename tmat2x2<T>::col_type const & v,
tmat2x2<T> const & m);
template <typename T>
tmat2x2<T> operator* (
GLM_FUNC_DECL tmat2x2<T> operator* (
tmat2x2<T> const & m1,
tmat2x2<T> const & m2);
template <typename T>
tmat3x2<T> operator* (
GLM_FUNC_DECL tmat3x2<T> operator* (
tmat2x2<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
tmat4x2<T> operator* (
GLM_FUNC_DECL tmat4x2<T> operator* (
tmat2x2<T> const & m1,
tmat4x2<T> const & m2);
template <typename T>
tmat2x2<T> operator/ (
GLM_FUNC_DECL tmat2x2<T> operator/ (
tmat2x2<T> const & m,
typename tmat2x2<T>::value_type const & s);
template <typename T>
tmat2x2<T> operator/ (
GLM_FUNC_DECL tmat2x2<T> operator/ (
typename tmat2x2<T>::value_type const & s,
tmat2x2<T> const & m);
template <typename T>
typename tmat2x2<T>::col_type operator/ (
GLM_FUNC_DECL typename tmat2x2<T>::col_type operator/ (
tmat2x2<T> const & m,
typename tmat2x2<T>::row_type const & v);
template <typename T>
typename tmat2x2<T>::row_type operator/ (
GLM_FUNC_DECL typename tmat2x2<T>::row_type operator/ (
typename tmat2x2<T>::col_type const & v,
tmat2x2<T> const & m);
template <typename T>
tmat2x2<T> operator/ (
GLM_FUNC_DECL tmat2x2<T> operator/ (
tmat2x2<T> const & m1,
tmat2x2<T> const & m2);
// Unary constant operators
template <typename T>
tmat2x2<T> const operator- (
GLM_FUNC_DECL tmat2x2<T> const operator- (
tmat2x2<T> const & m);
template <typename T>
tmat2x2<T> const operator-- (
GLM_FUNC_DECL tmat2x2<T> const operator-- (
tmat2x2<T> const & m,
int);
template <typename T>
tmat2x2<T> const operator++ (
GLM_FUNC_DECL tmat2x2<T> const operator++ (
tmat2x2<T> const & m,
int);
} //namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -306,10 +306,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -330,10 +327,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -354,10 +348,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -376,10 +367,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T>& tmat2x2<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -115,27 +115,27 @@ namespace detail
GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T> const & x);
// Accesses
col_type & operator[](size_type i);
col_type const & operator[](size_type i) const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
// Unary updatable operators
GLM_FUNC_DECL tmat2x3<T> & operator= (tmat2x3<T> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator= (tmat2x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator+= (U const & s);
GLM_FUNC_DECL tmat2x3<T> & operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator+= (tmat2x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator-= (U const & s);
GLM_FUNC_DECL tmat2x3<T> & operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator-= (tmat2x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator*= (U const & s);
GLM_FUNC_DECL tmat2x3<T> & operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator*= (tmat2x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T> & operator/= (U const & s);
GLM_FUNC_DECL tmat2x3<T> & operator/= (U s);
GLM_FUNC_DECL tmat2x3<T> & operator++ ();
GLM_FUNC_DECL tmat2x3<T> & operator-- ();
@ -143,82 +143,82 @@ namespace detail
// Binary operators
template <typename T>
tmat2x3<T> operator+ (
GLM_FUNC_DECL tmat2x3<T> operator+ (
tmat2x3<T> const & m,
typename tmat2x3<T>::value_type const & s);
template <typename T>
tmat2x3<T> operator+ (
GLM_FUNC_DECL tmat2x3<T> operator+ (
tmat2x3<T> const & m1,
tmat2x3<T> const & m2);
template <typename T>
tmat2x3<T> operator- (
GLM_FUNC_DECL tmat2x3<T> operator- (
tmat2x3<T> const & m,
typename tmat2x3<T>::value_type const & s);
template <typename T>
tmat2x3<T> operator- (
GLM_FUNC_DECL tmat2x3<T> operator- (
tmat2x3<T> const & m1,
tmat2x3<T> const & m2);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
tmat2x3<T> const & m,
typename tmat2x3<T>::value_type const & s);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
typename tmat2x3<T>::value_type const & s,
tmat2x3<T> const & m);
template <typename T>
typename tmat2x3<T>::col_type operator* (
GLM_FUNC_DECL typename tmat2x3<T>::col_type operator* (
tmat2x3<T> const & m,
typename tmat2x3<T>::row_type const & v);
template <typename T>
typename tmat2x3<T>::row_type operator* (
GLM_FUNC_DECL typename tmat2x3<T>::row_type operator* (
typename tmat2x3<T>::col_type const & v,
tmat2x3<T> const & m);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
tmat2x3<T> const & m1,
tmat2x2<T> const & m2);
template <typename T>
tmat3x3<T> operator* (
GLM_FUNC_DECL tmat3x3<T> operator* (
tmat2x3<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
tmat4x3<T> operator* (
GLM_FUNC_DECL tmat4x3<T> operator* (
tmat2x3<T> const & m1,
tmat4x2<T> const & m2);
template <typename T>
tmat2x3<T> operator/ (
GLM_FUNC_DECL tmat2x3<T> operator/ (
tmat2x3<T> const & m,
typename tmat2x3<T>::value_type const & s);
template <typename T>
tmat2x3<T> operator/ (
GLM_FUNC_DECL tmat2x3<T> operator/ (
typename tmat2x3<T>::value_type const & s,
tmat2x3<T> const & m);
// Unary constant operators
template <typename T>
tmat2x3<T> const operator- (
GLM_FUNC_DECL tmat2x3<T> const operator- (
tmat2x3<T> const & m);
template <typename T>
tmat2x3<T> const operator-- (
GLM_FUNC_DECL tmat2x3<T> const operator-- (
tmat2x3<T> const & m,
int);
template <typename T>
tmat2x3<T> const operator++ (
GLM_FUNC_DECL tmat2x3<T> const operator++ (
tmat2x3<T> const & m,
int);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -293,10 +293,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T> & tmat2x3<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T> & tmat2x3<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -317,10 +314,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T>& tmat2x3<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T>& tmat2x3<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -341,10 +335,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T>& tmat2x3<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T>& tmat2x3<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -363,10 +354,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T> & tmat2x3<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T> & tmat2x3<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -125,19 +125,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator= (tmat2x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator+= (U const & s);
GLM_FUNC_DECL tmat2x4<T>& operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator+= (tmat2x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator-= (U const & s);
GLM_FUNC_DECL tmat2x4<T>& operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator-= (tmat2x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator*= (U const & s);
GLM_FUNC_DECL tmat2x4<T>& operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator*= (tmat2x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T>& operator/= (U const & s);
GLM_FUNC_DECL tmat2x4<T>& operator/= (U s);
GLM_FUNC_DECL tmat2x4<T>& operator++ ();
GLM_FUNC_DECL tmat2x4<T>& operator-- ();
@ -145,82 +145,82 @@ namespace detail
// Binary operators
template <typename T>
tmat2x4<T> operator+ (
GLM_FUNC_DECL tmat2x4<T> operator+ (
tmat2x4<T> const & m,
typename tmat2x4<T>::value_type const & s);
template <typename T>
tmat2x4<T> operator+ (
GLM_FUNC_DECL tmat2x4<T> operator+ (
tmat2x4<T> const & m1,
tmat2x4<T> const & m2);
template <typename T>
tmat2x4<T> operator- (
GLM_FUNC_DECL tmat2x4<T> operator- (
tmat2x4<T> const & m,
typename tmat2x4<T>::value_type const & s);
template <typename T>
tmat2x4<T> operator- (
GLM_FUNC_DECL tmat2x4<T> operator- (
tmat2x4<T> const & m1,
tmat2x4<T> const & m2);
template <typename T>
tmat2x4<T> operator* (
GLM_FUNC_DECL tmat2x4<T> operator* (
tmat2x4<T> const & m,
typename tmat2x4<T>::value_type const & s);
template <typename T>
tmat2x4<T> operator* (
GLM_FUNC_DECL tmat2x4<T> operator* (
typename tmat2x4<T>::value_type const & s,
tmat2x4<T> const & m);
template <typename T>
typename tmat2x4<T>::col_type operator* (
GLM_FUNC_DECL typename tmat2x4<T>::col_type operator* (
tmat2x4<T> const & m,
typename tmat2x4<T>::row_type const & v);
template <typename T>
typename tmat2x4<T>::row_type operator* (
GLM_FUNC_DECL typename tmat2x4<T>::row_type operator* (
typename tmat2x4<T>::col_type const & v,
tmat2x4<T> const & m);
template <typename T>
tmat4x4<T> operator* (
GLM_FUNC_DECL tmat4x4<T> operator* (
tmat2x4<T> const & m1,
tmat4x2<T> const & m2);
template <typename T>
tmat2x4<T> operator* (
GLM_FUNC_DECL tmat2x4<T> operator* (
tmat2x4<T> const & m1,
tmat2x2<T> const & m2);
template <typename T>
tmat3x4<T> operator* (
GLM_FUNC_DECL tmat3x4<T> operator* (
tmat2x4<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
tmat2x4<T> operator/ (
GLM_FUNC_DECL tmat2x4<T> operator/ (
tmat2x4<T> const & m,
typename tmat2x4<T>::value_type const & s);
template <typename T>
tmat2x4<T> operator/ (
GLM_FUNC_DECL tmat2x4<T> operator/ (
typename tmat2x4<T>::value_type const & s,
tmat2x4<T> const & m);
// Unary constant operators
template <typename T>
tmat2x4<T> const operator- (
GLM_FUNC_DECL tmat2x4<T> const operator- (
tmat2x4<T> const & m);
template <typename T>
tmat2x4<T> const operator-- (
GLM_FUNC_DECL tmat2x4<T> const operator-- (
tmat2x4<T> const & m,
int);
template <typename T>
tmat2x4<T> const operator++ (
GLM_FUNC_DECL tmat2x4<T> const operator++ (
tmat2x4<T> const & m,
int);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -109,7 +109,7 @@ namespace detail
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
this->value[1] = col_type(Zero, Zero, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero, Zero);
}
template <typename T>
@ -296,10 +296,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -320,10 +317,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -344,10 +338,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T>& tmat2x4<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -366,10 +357,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T> & tmat2x4<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T> & tmat2x4<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -131,19 +131,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator= (tmat3x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator+= (U const & s);
GLM_FUNC_DECL tmat3x2<T> & operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator+= (tmat3x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator-= (U const & s);
GLM_FUNC_DECL tmat3x2<T> & operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator-= (tmat3x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator*= (U const & s);
GLM_FUNC_DECL tmat3x2<T> & operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator*= (tmat3x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T> & operator/= (U const & s);
GLM_FUNC_DECL tmat3x2<T> & operator/= (U s);
GLM_FUNC_DECL tmat3x2<T> & operator++ ();
GLM_FUNC_DECL tmat3x2<T> & operator-- ();
@ -151,82 +151,82 @@ namespace detail
// Binary operators
template <typename T>
tmat3x2<T> operator+ (
tmat3x2<T> const & m,
typename tmat3x2<T>::value_type const & s);
template <typename T>
tmat3x2<T> operator+ (
tmat3x2<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
tmat3x2<T> operator- (
GLM_FUNC_DECL tmat3x2<T> operator+ (
tmat3x2<T> const & m,
typename tmat3x2<T>::value_type const & s);
template <typename T>
tmat3x2<T> operator- (
GLM_FUNC_DECL tmat3x2<T> operator+ (
tmat3x2<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
tmat3x2<T> operator* (
GLM_FUNC_DECL tmat3x2<T> operator- (
tmat3x2<T> const & m,
typename tmat3x2<T>::value_type const & s);
template <typename T>
tmat3x2<T> operator* (
GLM_FUNC_DECL tmat3x2<T> operator- (
tmat3x2<T> const & m1,
tmat3x2<T> const & m2);
template <typename T>
GLM_FUNC_DECL tmat3x2<T> operator* (
tmat3x2<T> const & m,
typename tmat3x2<T>::value_type const & s);
template <typename T>
GLM_FUNC_DECL tmat3x2<T> operator* (
typename tmat3x2<T>::value_type const & s,
tmat3x2<T> const & m);
template <typename T>
typename tmat3x2<T>::col_type operator* (
GLM_FUNC_DECL typename tmat3x2<T>::col_type operator* (
tmat3x2<T> const & m,
typename tmat3x2<T>::row_type const & v);
template <typename T>
typename tmat3x2<T>::row_type operator* (
GLM_FUNC_DECL typename tmat3x2<T>::row_type operator* (
typename tmat3x2<T>::col_type const & v,
tmat3x2<T> const & m);
template <typename T>
tmat2x2<T> operator* (
GLM_FUNC_DECL tmat2x2<T> operator* (
tmat3x2<T> const & m1,
tmat2x3<T> const & m2);
template <typename T>
tmat3x2<T> operator* (
GLM_FUNC_DECL tmat3x2<T> operator* (
tmat3x2<T> const & m1,
tmat3x3<T> const & m2);
template <typename T>
tmat4x2<T> operator* (
GLM_FUNC_DECL tmat4x2<T> operator* (
tmat3x2<T> const & m1,
tmat4x3<T> const & m2);
template <typename T>
tmat3x2<T> operator/ (
GLM_FUNC_DECL tmat3x2<T> operator/ (
tmat3x2<T> const & m,
typename tmat3x2<T>::value_type const & s);
template <typename T>
tmat3x2<T> operator/ (
GLM_FUNC_DECL tmat3x2<T> operator/ (
typename tmat3x2<T>::value_type const & s,
tmat3x2<T> const & m);
// Unary constant operators
template <typename T>
tmat3x2<T> const operator- (
GLM_FUNC_DECL tmat3x2<T> const operator- (
tmat3x2<T> const & m);
template <typename T>
tmat3x2<T> const operator-- (
GLM_FUNC_DECL tmat3x2<T> const operator-- (
tmat3x2<T> const & m,
int);
template <typename T>
tmat3x2<T> const operator++ (
GLM_FUNC_DECL tmat3x2<T> const operator++ (
tmat3x2<T> const & m,
int);
} //namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -317,10 +317,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -343,10 +340,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -369,10 +363,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T>& tmat3x2<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -392,10 +383,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T> & tmat3x2<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T> & tmat3x2<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -137,19 +137,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator= (tmat3x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator+= (U const & s);
GLM_FUNC_DECL tmat3x3<T>& operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator+= (tmat3x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator-= (U const & s);
GLM_FUNC_DECL tmat3x3<T>& operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator-= (tmat3x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator*= (U const & s);
GLM_FUNC_DECL tmat3x3<T>& operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator*= (tmat3x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator/= (U const & s);
GLM_FUNC_DECL tmat3x3<T>& operator/= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T>& operator/= (tmat3x3<U> const & m);
GLM_FUNC_DECL tmat3x3<T>& operator++ ();
@ -158,107 +158,107 @@ namespace detail
// Binary operators
template <typename T>
tmat3x3<T> operator+ (
GLM_FUNC_DECL tmat3x3<T> operator+ (
tmat3x3<T> const & m,
typename tmat3x3<T>::value_type const & s);
template <typename T>
tmat3x3<T> operator+ (
GLM_FUNC_DECL tmat3x3<T> operator+ (
typename tmat3x3<T>::value_type const & s,
tmat3x3<T> const & m);
template <typename T>
tmat3x3<T> operator+ (
GLM_FUNC_DECL tmat3x3<T> operator+ (
tmat3x3<T> const & m1,
tmat3x3<T> const & m2);
template <typename T>
tmat3x3<T> operator- (
GLM_FUNC_DECL tmat3x3<T> operator- (
tmat3x3<T> const & m,
typename tmat3x3<T>::value_type const & s);
template <typename T>
tmat3x3<T> operator- (
GLM_FUNC_DECL tmat3x3<T> operator- (
typename tmat3x3<T>::value_type const & s,
tmat3x3<T> const & m);
template <typename T>
tmat3x3<T> operator- (
GLM_FUNC_DECL tmat3x3<T> operator- (
tmat3x3<T> const & m1,
tmat3x3<T> const & m2);
template <typename T>
tmat3x3<T> operator* (
GLM_FUNC_DECL tmat3x3<T> operator* (
tmat3x3<T> const & m,
typename tmat3x3<T>::value_type const & s);
template <typename T>
tmat3x3<T> operator* (
GLM_FUNC_DECL tmat3x3<T> operator* (
typename tmat3x3<T>::value_type const & s,
tmat3x3<T> const & m);
template <typename T>
typename tmat3x3<T>::col_type operator* (
GLM_FUNC_DECL typename tmat3x3<T>::col_type operator* (
tmat3x3<T> const & m,
typename tmat3x3<T>::row_type const & v);
template <typename T>
typename tmat3x3<T>::row_type operator* (
GLM_FUNC_DECL typename tmat3x3<T>::row_type operator* (
typename tmat3x3<T>::col_type const & v,
tmat3x3<T> const & m);
template <typename T>
tmat3x3<T> operator* (
GLM_FUNC_DECL tmat3x3<T> operator* (
tmat3x3<T> const & m1,
tmat3x3<T> const & m2);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
tmat3x3<T> const & m1,
tmat2x3<T> const & m2);
template <typename T>
tmat4x3<T> operator* (
GLM_FUNC_DECL tmat4x3<T> operator* (
tmat3x3<T> const & m1,
tmat4x3<T> const & m2);
template <typename T>
tmat3x3<T> operator/ (
GLM_FUNC_DECL tmat3x3<T> operator/ (
tmat3x3<T> const & m,
typename tmat3x3<T>::value_type const & s);
template <typename T>
tmat3x3<T> operator/ (
GLM_FUNC_DECL tmat3x3<T> operator/ (
typename tmat3x3<T>::value_type const & s,
tmat3x3<T> const & m);
template <typename T>
typename tmat3x3<T>::col_type operator/ (
GLM_FUNC_DECL typename tmat3x3<T>::col_type operator/ (
tmat3x3<T> const & m,
typename tmat3x3<T>::row_type const & v);
template <typename T>
typename tmat3x3<T>::row_type operator/ (
GLM_FUNC_DECL typename tmat3x3<T>::row_type operator/ (
typename tmat3x3<T>::col_type const & v,
tmat3x3<T> const & m);
template <typename T>
tmat3x3<T> operator/ (
GLM_FUNC_DECL tmat3x3<T> operator/ (
tmat3x3<T> const & m1,
tmat3x3<T> const & m2);
// Unary constant operators
template <typename T>
tmat3x3<T> const operator- (
GLM_FUNC_DECL tmat3x3<T> const operator- (
tmat3x3<T> const & m);
template <typename T>
tmat3x3<T> const operator-- (
GLM_FUNC_DECL tmat3x3<T> const operator-- (
tmat3x3<T> const & m,
int);
template <typename T>
tmat3x3<T> const operator++ (
GLM_FUNC_DECL tmat3x3<T> const operator++ (
tmat3x3<T> const & m,
int);
} //namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -320,10 +320,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -346,10 +343,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -372,10 +366,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -395,10 +386,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T> & tmat3x3<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -123,27 +123,27 @@ namespace detail
GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T> const & x);
// Accesses
col_type & operator[](size_type i);
col_type const & operator[](size_type i) const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
// Unary updatable operators
GLM_FUNC_DECL tmat3x4<T> & operator= (tmat3x4<T> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator= (tmat3x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator+= (U const & s);
GLM_FUNC_DECL tmat3x4<T> & operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator+= (tmat3x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator-= (U const & s);
GLM_FUNC_DECL tmat3x4<T> & operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator-= (tmat3x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator*= (U const & s);
GLM_FUNC_DECL tmat3x4<T> & operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator*= (tmat3x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T> & operator/= (U const & s);
GLM_FUNC_DECL tmat3x4<T> & operator/= (U s);
GLM_FUNC_DECL tmat3x4<T> & operator++ ();
GLM_FUNC_DECL tmat3x4<T> & operator-- ();
@ -151,82 +151,82 @@ namespace detail
// Binary operators
template <typename T>
tmat3x4<T> operator+ (
GLM_FUNC_DECL tmat3x4<T> operator+ (
tmat3x4<T> const & m,
typename tmat3x4<T>::value_type const & s);
template <typename T>
tmat3x4<T> operator+ (
GLM_FUNC_DECL tmat3x4<T> operator+ (
tmat3x4<T> const & m1,
tmat3x4<T> const & m2);
template <typename T>
tmat3x4<T> operator- (
GLM_FUNC_DECL tmat3x4<T> operator- (
tmat3x4<T> const & m,
typename tmat3x4<T>::value_type const & s);
template <typename T>
tmat3x4<T> operator- (
GLM_FUNC_DECL tmat3x4<T> operator- (
tmat3x4<T> const & m1,
tmat3x4<T> const & m2);
template <typename T>
tmat3x4<T> operator* (
GLM_FUNC_DECL tmat3x4<T> operator* (
tmat3x4<T> const & m,
typename tmat3x4<T>::value_type const & s);
template <typename T>
tmat3x4<T> operator* (
GLM_FUNC_DECL tmat3x4<T> operator* (
typename tmat3x4<T>::value_type const & s,
tmat3x4<T> const & m);
template <typename T>
typename tmat3x4<T>::col_type operator* (
GLM_FUNC_DECL typename tmat3x4<T>::col_type operator* (
tmat3x4<T> const & m,
typename tmat3x4<T>::row_type const & v);
template <typename T>
typename tmat3x4<T>::row_type operator* (
GLM_FUNC_DECL typename tmat3x4<T>::row_type operator* (
typename tmat3x4<T>::col_type const & v,
tmat3x4<T> const & m);
template <typename T>
tmat4x4<T> operator* (
GLM_FUNC_DECL tmat4x4<T> operator* (
tmat3x4<T> const & m1,
tmat4x3<T> const & m2);
template <typename T>
tmat2x4<T> operator* (
GLM_FUNC_DECL tmat2x4<T> operator* (
tmat3x4<T> const & m1,
tmat2x3<T> const & m2);
template <typename T>
tmat3x4<T> operator* (
GLM_FUNC_DECL tmat3x4<T> operator* (
tmat3x4<T> const & m1,
tmat3x3<T> const & m2);
template <typename T>
tmat3x4<T> operator/ (
GLM_FUNC_DECL tmat3x4<T> operator/ (
tmat3x4<T> const & m,
typename tmat3x4<T>::value_type const & s);
template <typename T>
tmat3x4<T> operator/ (
GLM_FUNC_DECL tmat3x4<T> operator/ (
typename tmat3x4<T>::value_type const & s,
tmat3x4<T> const & m);
// Unary constant operators
template <typename T>
tmat3x4<T> const operator- (
GLM_FUNC_DECL tmat3x4<T> const operator- (
tmat3x4<T> const & m);
template <typename T>
tmat3x4<T> const operator-- (
GLM_FUNC_DECL tmat3x4<T> const operator-- (
tmat3x4<T> const & m,
int);
template <typename T>
tmat3x4<T> const operator++ (
GLM_FUNC_DECL tmat3x4<T> const operator++ (
tmat3x4<T> const & m,
int);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -316,10 +316,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -342,10 +339,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -368,10 +362,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T>& tmat3x4<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -391,10 +382,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T> & tmat3x4<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T> & tmat3x4<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -136,19 +136,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator= (tmat4x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator+= (U const & s);
GLM_FUNC_DECL tmat4x2<T>& operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator+= (tmat4x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator-= (U const & s);
GLM_FUNC_DECL tmat4x2<T>& operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator-= (tmat4x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator*= (U const & s);
GLM_FUNC_DECL tmat4x2<T>& operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator*= (tmat4x2<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T>& operator/= (U const & s);
GLM_FUNC_DECL tmat4x2<T>& operator/= (U s);
GLM_FUNC_DECL tmat4x2<T>& operator++ ();
GLM_FUNC_DECL tmat4x2<T>& operator-- ();
@ -156,82 +156,82 @@ namespace detail
// Binary operators
template <typename T>
tmat4x2<T> operator+ (
GLM_FUNC_DECL tmat4x2<T> operator+ (
tmat4x2<T> const & m,
typename tmat4x2<T>::value_type const & s);
template <typename T>
tmat4x2<T> operator+ (
GLM_FUNC_DECL tmat4x2<T> operator+ (
tmat4x2<T> const & m1,
tmat4x2<T> const & m2);
template <typename T>
tmat4x2<T> operator- (
GLM_FUNC_DECL tmat4x2<T> operator- (
tmat4x2<T> const & m,
typename tmat4x2<T>::value_type const & s);
template <typename T>
tmat4x2<T> operator- (
GLM_FUNC_DECL tmat4x2<T> operator- (
tmat4x2<T> const & m1,
tmat4x2<T> const & m2);
template <typename T>
tmat4x2<T> operator* (
GLM_FUNC_DECL tmat4x2<T> operator* (
tmat4x2<T> const & m,
typename tmat4x2<T>::value_type const & s);
template <typename T>
tmat4x2<T> operator* (
GLM_FUNC_DECL tmat4x2<T> operator* (
typename tmat4x2<T>::value_type const & s,
tmat4x2<T> const & m);
template <typename T>
typename tmat4x2<T>::col_type operator* (
GLM_FUNC_DECL typename tmat4x2<T>::col_type operator* (
tmat4x2<T> const & m,
typename tmat4x2<T>::row_type const & v);
template <typename T>
typename tmat4x2<T>::row_type operator* (
GLM_FUNC_DECL typename tmat4x2<T>::row_type operator* (
typename tmat4x2<T>::col_type const & v,
tmat4x2<T> const & m);
template <typename T>
tmat3x2<T> operator* (
GLM_FUNC_DECL tmat3x2<T> operator* (
tmat4x2<T> const & m1,
tmat3x4<T> const & m2);
template <typename T>
tmat4x2<T> operator* (
GLM_FUNC_DECL tmat4x2<T> operator* (
tmat4x2<T> const & m1,
tmat4x4<T> const & m2);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
tmat4x3<T> const & m1,
tmat2x4<T> const & m2);
template <typename T>
tmat4x2<T> operator/ (
GLM_FUNC_DECL tmat4x2<T> operator/ (
tmat4x2<T> const & m,
typename tmat4x2<T>::value_type const & s);
template <typename T>
tmat4x2<T> operator/ (
GLM_FUNC_DECL tmat4x2<T> operator/ (
typename tmat4x2<T>::value_type const & s,
tmat4x2<T> const & m);
// Unary constant operators
template <typename T>
tmat4x2<T> const operator- (
GLM_FUNC_DECL tmat4x2<T> const operator- (
tmat4x2<T> const & m);
template <typename T>
tmat4x2<T> const operator-- (
GLM_FUNC_DECL tmat4x2<T> const operator-- (
tmat4x2<T> const & m,
int);
template <typename T>
tmat4x2<T> const operator++ (
GLM_FUNC_DECL tmat4x2<T> const operator++ (
tmat4x2<T> const & m,
int);
} //namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -342,10 +342,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -370,10 +367,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -398,10 +392,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -422,10 +413,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -126,27 +126,27 @@ namespace detail
GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T> const & x);
// Accesses
col_type & operator[](size_type i);
col_type const & operator[](size_type i) const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
// Unary updatable operators
GLM_FUNC_DECL tmat4x3<T> & operator= (tmat4x3<T> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator= (tmat4x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator+= (U const & s);
GLM_FUNC_DECL tmat4x3<T> & operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator+= (tmat4x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator-= (U const & s);
GLM_FUNC_DECL tmat4x3<T> & operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator-= (tmat4x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator*= (U const & s);
GLM_FUNC_DECL tmat4x3<T> & operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator*= (tmat4x3<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T> & operator/= (U const & s);
GLM_FUNC_DECL tmat4x3<T> & operator/= (U s);
GLM_FUNC_DECL tmat4x3<T> & operator++ ();
GLM_FUNC_DECL tmat4x3<T> & operator-- ();
@ -154,82 +154,82 @@ namespace detail
// Binary operators
template <typename T>
tmat4x3<T> operator+ (
GLM_FUNC_DECL tmat4x3<T> operator+ (
tmat4x3<T> const & m,
typename tmat4x3<T>::value_type const & s);
template <typename T>
tmat4x3<T> operator+ (
GLM_FUNC_DECL tmat4x3<T> operator+ (
tmat4x3<T> const & m1,
tmat4x3<T> const & m2);
template <typename T>
tmat4x3<T> operator- (
GLM_FUNC_DECL tmat4x3<T> operator- (
tmat4x3<T> const & m,
typename tmat4x3<T>::value_type const & s);
template <typename T>
tmat4x3<T> operator- (
GLM_FUNC_DECL tmat4x3<T> operator- (
tmat4x3<T> const & m1,
tmat4x3<T> const & m2);
template <typename T>
tmat4x3<T> operator* (
GLM_FUNC_DECL tmat4x3<T> operator* (
tmat4x3<T> const & m,
typename tmat4x3<T>::value_type const & s);
template <typename T>
tmat4x3<T> operator* (
GLM_FUNC_DECL tmat4x3<T> operator* (
typename tmat4x3<T>::value_type const & s,
tmat4x3<T> const & m);
template <typename T>
typename tmat4x3<T>::col_type operator* (
GLM_FUNC_DECL typename tmat4x3<T>::col_type operator* (
tmat4x3<T> const & m,
typename tmat4x3<T>::row_type const & v);
template <typename T>
typename tmat4x3<T>::row_type operator* (
GLM_FUNC_DECL typename tmat4x3<T>::row_type operator* (
typename tmat4x3<T>::col_type const & v,
tmat4x3<T> const & m);
template <typename T>
tmat2x3<T> operator* (
GLM_FUNC_DECL tmat2x3<T> operator* (
tmat4x3<T> const & m1,
tmat2x4<T> const & m2);
template <typename T>
tmat3x3<T> operator* (
GLM_FUNC_DECL tmat3x3<T> operator* (
tmat4x3<T> const & m1,
tmat3x4<T> const & m2);
template <typename T>
tmat4x3<T> operator* (
GLM_FUNC_DECL tmat4x3<T> operator* (
tmat4x3<T> const & m1,
tmat4x4<T> const & m2);
template <typename T>
tmat4x3<T> operator/ (
GLM_FUNC_DECL tmat4x3<T> operator/ (
tmat4x3<T> const & m,
typename tmat4x3<T>::value_type const & s);
template <typename T>
tmat4x3<T> operator/ (
GLM_FUNC_DECL tmat4x3<T> operator/ (
typename tmat4x3<T>::value_type const & s,
tmat4x3<T> const & m);
// Unary constant operators
template <typename T>
tmat4x3<T> const operator- (
GLM_FUNC_DECL tmat4x3<T> const operator- (
tmat4x3<T> const & m);
template <typename T>
tmat4x3<T> const operator-- (
GLM_FUNC_DECL tmat4x3<T> const operator-- (
tmat4x3<T> const & m,
int);
template <typename T>
tmat4x3<T> const operator++ (
GLM_FUNC_DECL tmat4x3<T> const operator++ (
tmat4x3<T> const & m,
int);
}//namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -344,10 +344,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -372,10 +369,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -400,10 +394,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -424,10 +415,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x3<T> & tmat4x3<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -140,19 +140,19 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator= (tmat4x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator+= (U const & s);
GLM_FUNC_DECL tmat4x4<T> & operator+= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator+= (tmat4x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator-= (U const & s);
GLM_FUNC_DECL tmat4x4<T> & operator-= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator-= (tmat4x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator*= (U const & s);
GLM_FUNC_DECL tmat4x4<T> & operator*= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator*= (tmat4x4<U> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator/= (U const & s);
GLM_FUNC_DECL tmat4x4<T> & operator/= (U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T> & operator/= (tmat4x4<U> const & m);
GLM_FUNC_DECL tmat4x4<T> & operator++ ();
@ -161,106 +161,106 @@ namespace detail
// Binary operators
template <typename T>
tmat4x4<T> operator+ (
GLM_FUNC_DECL tmat4x4<T> operator+ (
tmat4x4<T> const & m,
typename tmat4x4<T>::value_type const & s);
template <typename T>
tmat4x4<T> operator+ (
GLM_FUNC_DECL tmat4x4<T> operator+ (
typename tmat4x4<T>::value_type const & s,
tmat4x4<T> const & m);
template <typename T>
tmat4x4<T> operator+ (
GLM_FUNC_DECL tmat4x4<T> operator+ (
tmat4x4<T> const & m1,
tmat4x4<T> const & m2);
template <typename T>
tmat4x4<T> operator- (
GLM_FUNC_DECL tmat4x4<T> operator- (
tmat4x4<T> const & m,
typename tmat4x4<T>::value_type const & s);
template <typename T>
tmat4x4<T> operator- (
GLM_FUNC_DECL tmat4x4<T> operator- (
typename tmat4x4<T>::value_type const & s,
tmat4x4<T> const & m);
template <typename T>
tmat4x4<T> operator- (
GLM_FUNC_DECL tmat4x4<T> operator- (
tmat4x4<T> const & m1,
tmat4x4<T> const & m2);
template <typename T>
tmat4x4<T> operator* (
GLM_FUNC_DECL tmat4x4<T> operator* (
tmat4x4<T> const & m,
typename tmat4x4<T>::value_type const & s);
template <typename T>
tmat4x4<T> operator* (
GLM_FUNC_DECL tmat4x4<T> operator* (
typename tmat4x4<T>::value_type const & s,
tmat4x4<T> const & m);
template <typename T>
typename tmat4x4<T>::col_type operator* (
GLM_FUNC_DECL typename tmat4x4<T>::col_type operator* (
tmat4x4<T> const & m,
typename tmat4x4<T>::row_type const & v);
template <typename T>
typename tmat4x4<T>::row_type operator* (
GLM_FUNC_DECL typename tmat4x4<T>::row_type operator* (
typename tmat4x4<T>::col_type const & v,
tmat4x4<T> const & m);
template <typename T>
tmat2x4<T> operator* (
GLM_FUNC_DECL tmat2x4<T> operator* (
tmat4x4<T> const & m1,
tmat2x4<T> const & m2);
template <typename T>
tmat3x4<T> operator* (
GLM_FUNC_DECL tmat3x4<T> operator* (
tmat4x4<T> const & m1,
tmat3x4<T> const & m2);
template <typename T>
tmat4x4<T> operator* (
GLM_FUNC_DECL tmat4x4<T> operator* (
tmat4x4<T> const & m1,
tmat4x4<T> const & m2);
template <typename T>
tmat4x4<T> operator/ (
GLM_FUNC_DECL tmat4x4<T> operator/ (
tmat4x4<T> const & m,
typename tmat4x4<T>::value_type const & s);
template <typename T>
tmat4x4<T> operator/ (
GLM_FUNC_DECL tmat4x4<T> operator/ (
typename tmat4x4<T>::value_type const & s,
tmat4x4<T> const & m);
template <typename T>
typename tmat4x4<T>::col_type operator/ (
GLM_FUNC_DECL typename tmat4x4<T>::col_type operator/ (
tmat4x4<T> const & m,
typename tmat4x4<T>::row_type const & v);
template <typename T>
typename tmat4x4<T>::row_type operator/ (
GLM_FUNC_DECL typename tmat4x4<T>::row_type operator/ (
typename tmat4x4<T>::col_type & v,
tmat4x4<T> const & m);
template <typename T>
tmat4x4<T> operator/ (
GLM_FUNC_DECL tmat4x4<T> operator/ (
tmat4x4<T> const & m1,
tmat4x4<T> const & m2);
// Unary constant operators
template <typename T>
tmat4x4<T> const operator- (
GLM_FUNC_DECL tmat4x4<T> const operator- (
tmat4x4<T> const & m);
template <typename T>
tmat4x4<T> const operator-- (
GLM_FUNC_DECL tmat4x4<T> const operator-- (
tmat4x4<T> const & m, int);
template <typename T>
tmat4x4<T> const operator++ (
GLM_FUNC_DECL tmat4x4<T> const operator++ (
tmat4x4<T> const & m, int);
} //namespace detail

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -191,7 +191,7 @@ namespace detail
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4
)
)
{
GLM_STATIC_ASSERT(detail::type<X1>::is_float || std::numeric_limits<X1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(detail::type<Y1>::is_float || std::numeric_limits<Y1>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
@ -374,10 +374,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T>& tmat4x4<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T>& tmat4x4<T>::operator+= (U s)
{
this->value[0] += s;
this->value[1] += s;
@ -402,10 +399,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator-= (U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -430,10 +424,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator*= (U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -454,10 +445,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T> & tmat4x4<T>::operator/= (U s)
{
this->value[0] /= s;
this->value[1] /= s;

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -62,6 +62,10 @@ namespace detail
# if(GLM_COMPONENT == GLM_COMPONENT_CXX11)
union
{
struct{value_type x, y;};
struct{value_type r, g;};
struct{value_type s, t;};
# if(defined(GLM_SWIZZLE))
_GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, x, y)
_GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, r, g)
@ -73,10 +77,6 @@ namespace detail
_GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, r, g)
_GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g;};
struct{value_type s, t;};
struct{value_type x, y;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};
@ -123,7 +123,7 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
tvec2(tref2<T> const & r);
GLM_FUNC_DECL tvec2(tref2<T> const & r);
template <int E0, int E1>
GLM_FUNC_DECL tvec2(const glm::detail::swizzle<2,T,tvec2<T>,E0,E1,-1,-2>& that)
@ -165,19 +165,19 @@ namespace detail
GLM_FUNC_DECL tvec2<T> & operator= (tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator+=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator+=(tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator-=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator-=(tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator*=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator*=(tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator/=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator/=(tvec2<U> const & v);
GLM_FUNC_DECL tvec2<T> & operator++();
@ -187,27 +187,27 @@ namespace detail
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator%= (U const & s);
GLM_FUNC_DECL tvec2<T> & operator%= (U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator%= (tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator&= (U const & s);
GLM_FUNC_DECL tvec2<T> & operator&= (U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator&= (tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator|= (U const & s);
GLM_FUNC_DECL tvec2<T> & operator|= (U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator|= (tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator^= (U const & s);
GLM_FUNC_DECL tvec2<T> & operator^= (U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator^= (tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator<<=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator<<=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator<<=(tvec2<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator>>=(U const & s);
GLM_FUNC_DECL tvec2<T> & operator>>=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T> & operator>>=(tvec2<U> const & v);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -204,10 +204,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=(U s)
{
this->x += T(s);
this->y += T(s);
@ -228,10 +225,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=(U s)
{
this->x -= T(s);
this->y -= T(s);
@ -252,10 +246,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=(U s)
{
this->x *= T(s);
this->y *= T(s);
@ -276,10 +267,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=(U s)
{
this->x /= T(s);
this->y /= T(s);
@ -342,10 +330,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=(U s)
{
this->x %= T(s);
this->y %= T(s);
@ -366,10 +351,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=(U s)
{
this->x &= T(s);
this->y &= T(s);
@ -390,10 +372,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=(U s)
{
this->x |= T(s);
this->y |= T(s);
@ -414,10 +393,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=(U s)
{
this->x ^= T(s);
this->y ^= T(s);
@ -438,10 +414,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=(U s)
{
this->x <<= T(s);
this->y <<= T(s);
@ -462,10 +435,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=(U s)
{
this->x >>= T(s);
this->y >>= T(s);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -62,6 +62,10 @@ namespace detail
# if(GLM_COMPONENT == GLM_COMPONENT_CXX11)
union
{
struct{value_type x, y, z;};
struct{value_type r, g, b;};
struct{value_type s, t, p;};
# if(defined(GLM_SWIZZLE))
_GLM_SWIZZLE3_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, x, y, z)
_GLM_SWIZZLE3_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, r, g, b)
@ -73,10 +77,6 @@ namespace detail
_GLM_SWIZZLE3_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, r, g, b)
_GLM_SWIZZLE3_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t, p)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g, b;};
struct{value_type s, t, p;};
struct{value_type x, y, z;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};
@ -189,19 +189,19 @@ namespace detail
GLM_FUNC_DECL tvec3<T> & operator= (tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator+=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator+=(tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator-=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator-=(tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator*=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator*=(tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator/=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator/=(tvec3<U> const & v);
GLM_FUNC_DECL tvec3<T> & operator++();
@ -211,27 +211,27 @@ namespace detail
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator%= (U const & s);
GLM_FUNC_DECL tvec3<T> & operator%= (U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator%= (tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator&= (U const & s);
GLM_FUNC_DECL tvec3<T> & operator&= (U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator&= (tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator|= (U const & s);
GLM_FUNC_DECL tvec3<T> & operator|= (U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator|= (tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator^= (U const & s);
GLM_FUNC_DECL tvec3<T> & operator^= (U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator^= (tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator<<=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator<<=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator<<=(tvec3<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator>>=(U const & s);
GLM_FUNC_DECL tvec3<T> & operator>>=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T> & operator>>=(tvec3<U> const & v);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -255,10 +255,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=(U s)
{
this->x += T(s);
this->y += T(s);
@ -281,10 +278,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=(U s)
{
this->x -= T(s);
this->y -= T(s);
@ -307,10 +301,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=(U s)
{
this->x *= T(s);
this->y *= T(s);
@ -333,10 +324,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=(U s)
{
this->x /= T(s);
this->y /= T(s);
@ -403,10 +391,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=(U s)
{
this->x %= s;
this->y %= s;
@ -429,10 +414,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=(U s)
{
this->x &= s;
this->y &= s;
@ -455,10 +437,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=(U s)
{
this->x |= s;
this->y |= s;
@ -481,10 +460,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=(U s)
{
this->x ^= s;
this->y ^= s;
@ -507,10 +483,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=(U s)
{
this->x <<= s;
this->y <<= s;
@ -533,10 +506,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=(U s)
{
this->x >>= T(s);
this->y >>= T(s);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -62,6 +62,10 @@ namespace detail
# if(GLM_COMPONENT == GLM_COMPONENT_CXX11)
union
{
struct{value_type x, y, z, w;};
struct{value_type r, g, b, a;};
struct{value_type s, t, p, q;};
# if(defined(GLM_SWIZZLE))
_GLM_SWIZZLE4_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, r, g, b, a)
@ -73,10 +77,6 @@ namespace detail
_GLM_SWIZZLE4_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t, p, q)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g, b, a;};
struct{value_type s, t, p, q;};
struct{value_type x, y, z, w;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};
@ -244,19 +244,19 @@ namespace detail
GLM_FUNC_DECL tvec4<T> & operator= (tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator+=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator+=(tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator-=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator-=(tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator*=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator*=(tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator/=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator/=(tvec4<U> const & v);
GLM_FUNC_DECL tvec4<T> & operator++();
@ -266,27 +266,27 @@ namespace detail
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator%= (U const & s);
GLM_FUNC_DECL tvec4<T> & operator%= (U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator%= (tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator&= (U const & s);
GLM_FUNC_DECL tvec4<T> & operator&= (U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator&= (tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator|= (U const & s);
GLM_FUNC_DECL tvec4<T> & operator|= (U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator|= (tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator^= (U const & s);
GLM_FUNC_DECL tvec4<T> & operator^= (U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator^= (tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator<<=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator<<=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator<<=(tvec4<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator>>=(U const & s);
GLM_FUNC_DECL tvec4<T> & operator>>=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T> & operator>>=(tvec4<U> const & v);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
@ -396,10 +396,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+= (U s)
{
this->x += T(s);
this->y += T(s);
@ -424,10 +421,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-= (U s)
{
this->x -= T(s);
this->y -= T(s);
@ -452,10 +446,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*= (U s)
{
this->x *= T(s);
this->y *= T(s);
@ -480,10 +471,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/= (U s)
{
this->x /= T(s);
this->y /= T(s);
@ -531,10 +519,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%= (U s)
{
this->x %= T(s);
this->y %= T(s);
@ -559,10 +544,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&= (U s)
{
this->x &= T(s);
this->y &= T(s);
@ -587,10 +569,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|= (U s)
{
this->x |= T(s);
this->y |= T(s);
@ -615,10 +594,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^= (U s)
{
this->x ^= T(s);
this->y ^= T(s);
@ -643,10 +619,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<= (U s)
{
this->x <<= T(s);
this->y <<= T(s);
@ -671,10 +644,7 @@ namespace detail
template <typename T>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>= (U s)
{
this->x >>= T(s);
this->y >>= T(s);

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

View File

@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights

Some files were not shown because too many files have changed in this diff Show More