Turok
 
Loading...
Searching...
No Matches
kRenderModel Class Reference

Public Member Functions

void SetModel (const kStr &in modelPath, const kStr &in modelAnimPath)
 
void SetRotationOffset (const int nodeIndex, const float rads, const float x, const float y, const float z)
 
void SetRotationOffset (const int nodeIndex, const kQuat &in rotation)
 
void SetTexture (const int section, const int textureID)
 
void SetVisibility (const int nodeIndex, const bool visible)
 
void HideSection (const int nodeIndex, const int section, const bool hide)
 section is the surface index. must be 0-31 and must not be >= number of surfaces or will do nothing.
 
void AddTrailEffect (const kStr &in trailName, const int nodeIndex)
 
void RemoveTrailEffect ()
 Removes all trail effects.
 
const int GetNumAttachedTrails ()
 
kVec3Offset ()
 
const int GetNumNodes () const
 
kVec3 GetNodeOrigin (const int node, const kVec3 &in offset)
 Is calculated on draw. Can call ForceUpdateJoints if you need the current value for interpolation.
 
kQuat GetNodeRotation (const int node)
 Is calculated on draw. Can call ForceUpdateJoints if you need the current value for interpolation.
 
kVec3 GetNodeScale (const int node)
 
void ForceUpdateJoints (const float interpolatedFraction=1.0f)
 Force update node matrices and then call GetNodeOrigin/GetNodeRotation to get current value. interpolatedFraction should be in the range 0.0 (prev) to 1.0 (current). This is an expensive operation so use sparingly.
 
kStr GetModelFile () const
 
kStr GetAnimFile () const
 
const bool IsMorph () const
 
void SetMorphUpdating (const bool bUpdate)
 Set Morph Updating.
 
void GetMorphFrame (int &out frame, int &out nextFrame, int &out maxFrames, float &out time) const
 Get Morph frame info.
 
void SetMorphFrame (const int frame, const int nextFrame, const float time)
 
void ColorOverride (const int node, const float r=1.0f, const float g=1.0f, const float b=1.0f, const float a=1.0f)
 
void ColorOverrideSections (const int node, const int sectionMask=-1)
 enable the color override for specific sections(materials) on the node by setting each bit. -1 = All, 0 = Stop override
 

Detailed Description

Definition at line 943 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ AddTrailEffect()

void kRenderModel::AddTrailEffect ( const kStr &in trailName,
const int nodeIndex )

◆ ColorOverride()

void kRenderModel::ColorOverride ( const int node,
const float r = 1.0f,
const float g = 1.0f,
const float b = 1.0f,
const float a = 1.0f )

◆ ColorOverrideSections()

void kRenderModel::ColorOverrideSections ( const int node,
const int sectionMask = -1 )

enable the color override for specific sections(materials) on the node by setting each bit. -1 = All, 0 = Stop override

◆ ForceUpdateJoints()

void kRenderModel::ForceUpdateJoints ( const float interpolatedFraction = 1.0f)

Force update node matrices and then call GetNodeOrigin/GetNodeRotation to get current value. interpolatedFraction should be in the range 0.0 (prev) to 1.0 (current). This is an expensive operation so use sparingly.

◆ GetAnimFile()

kStr kRenderModel::GetAnimFile ( ) const

◆ GetModelFile()

kStr kRenderModel::GetModelFile ( ) const

◆ GetMorphFrame()

void kRenderModel::GetMorphFrame ( int &out frame,
int &out nextFrame,
int &out maxFrames,
float &out time ) const

Get Morph frame info.

Parameters
frame1=Init Frame, 2=Start Loop Frame. >= maxFrames then 1.
nextFrame2=Init Frame, 3=Start Loop Frame. >= maxFrames then 2.
maxFrames
time0..1 (lerp time between frame and nextFrame meshes)

◆ GetNodeOrigin()

kVec3 kRenderModel::GetNodeOrigin ( const int node,
const kVec3 &in offset )

Is calculated on draw. Can call ForceUpdateJoints if you need the current value for interpolation.

◆ GetNodeRotation()

kQuat kRenderModel::GetNodeRotation ( const int node)

Is calculated on draw. Can call ForceUpdateJoints if you need the current value for interpolation.

◆ GetNodeScale()

kVec3 kRenderModel::GetNodeScale ( const int node)

◆ GetNumAttachedTrails()

const int kRenderModel::GetNumAttachedTrails ( )

◆ GetNumNodes()

const int kRenderModel::GetNumNodes ( ) const

◆ HideSection()

void kRenderModel::HideSection ( const int nodeIndex,
const int section,
const bool hide )

section is the surface index. must be 0-31 and must not be >= number of surfaces or will do nothing.

◆ IsMorph()

const bool kRenderModel::IsMorph ( ) const

◆ Offset()

kVec3 & kRenderModel::Offset ( )

◆ RemoveTrailEffect()

void kRenderModel::RemoveTrailEffect ( )

Removes all trail effects.

◆ SetModel()

void kRenderModel::SetModel ( const kStr &in modelPath,
const kStr &in modelAnimPath )

◆ SetMorphFrame()

void kRenderModel::SetMorphFrame ( const int frame,
const int nextFrame,
const float time )

◆ SetMorphUpdating()

void kRenderModel::SetMorphUpdating ( const bool bUpdate)

Set Morph Updating.

Parameters
bUpdateSet to false to handle updating it yourself per ModelFile (not per Actor).

Default Tick code:

if(time >= 1.0f)
{
time = 0;
frame++;
if(frame >= maxFrames)
{
frame = 2;
}
nextFrame = frame + 1;
}
time += GAME_DELTA_TIME * 7.5f;
const float GAME_DELTA_TIME

◆ SetRotationOffset() [1/2]

void kRenderModel::SetRotationOffset ( const int nodeIndex,
const float rads,
const float x,
const float y,
const float z )

◆ SetRotationOffset() [2/2]

void kRenderModel::SetRotationOffset ( const int nodeIndex,
const kQuat &in rotation )

◆ SetTexture()

void kRenderModel::SetTexture ( const int section,
const int textureID )

◆ SetVisibility()

void kRenderModel::SetVisibility ( const int nodeIndex,
const bool visible )