Wasabi
Public Member Functions | Friends | List of all members
WInstance Class Reference

#include <WObject.hpp>

Inheritance diagram for WInstance:
WOrientation

Public Member Functions

void Scale (float x, float y, float z)
 
void Scale (WVector3 scale)
 
WVector3 GetScale () const
 
WMatrix GetWorldMatrix ()
 
bool UpdateLocals ()
 
void OnStateChange (STATE_CHANGE_TYPE type)
 
- Public Member Functions inherited from WOrientation
void SetPosition (float x, float y, float z)
 
void SetPosition (const WVector3 pos)
 
void Point (float x, float y, float z)
 
void Point (WVector3 target)
 
void SetAngle (WQuaternion quat)
 
void SetToRotation (const WOrientation *const device)
 
void SetULRVectors (WVector3 up, WVector3 look, WVector3 right)
 
void SetToTransformation (WMatrix mtx)
 
void Yaw (float angle)
 
void Roll (float angle)
 
void Pitch (float angle)
 
void Move (float units)
 
void Strafe (float units)
 
void Fly (float units)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
WVector3 GetPosition () const
 
float GetAngleX () const
 
float GetAngleY () const
 
float GetAngleZ () const
 
WQuaternion GetRotation () const
 
WVector3 GetUVector () const
 
WVector3 GetLVector () const
 
WVector3 GetRVector () const
 
virtual void SetBindingMatrix (WMatrix mtx)
 
void RemoveBinding ()
 
WMatrix GetBindingMatrix () const
 
bool IsBound () const
 
WMatrix ComputeTransformation () const
 
WMatrix ComputeInverseTransformation () const
 

Friends

class WObject
 

Detailed Description

An instance is used by a WObject to provide a way for users to easily access and modify instances of an object (when it enables geometry instancing).

Member Function Documentation

◆ GetScale()

WVector3 WInstance::GetScale ( ) const

Retrieves the scale factors of this instance.

Returns
3D vector containing the scale factors

◆ GetWorldMatrix()

WMatrix WInstance::GetWorldMatrix ( )

Retrieves the world matrix computed so far. A call to UpdateLocals() should be made prior to this one to ensure getting the most recent matrix.

Returns
World matrix of this instance

◆ OnStateChange()

void WInstance::OnStateChange ( STATE_CHANGE_TYPE  type)
virtual

A callback called by this class when the entity changes its position or orientation.

Parameters
typeOrientation change type

Reimplemented from WOrientation.

◆ Scale() [1/2]

void WInstance::Scale ( float  x,
float  y,
float  z 
)

Sets the scale of this instance.

Parameters
xX scale multiplier
yY scale multiplier
zZ scale multiplier

◆ Scale() [2/2]

void WInstance::Scale ( WVector3  scale)

Sets the scale of this instance.

Parameters
scaleScale factor components

◆ UpdateLocals()

bool WInstance::UpdateLocals ( )

Updates the locally computed world matrix of this instance. This function should only be called by WObject, otherwise changes might not be reflected on the instanced draw of the owner WObject.

Returns
true if changes have occurred since the last update, false otherwise

The documentation for this class was generated from the following file: