Cafu Engine
Cafu Engine Scripting
The open-source game engine and graphics engine for multiplayer, cross-platform, real-time 3D action
EntStaticDetailModelT Class Reference

A static detail model. More...

Inheritance diagram for EntStaticDetailModelT:

Public Member Functions

boolean IsPlayingAnim ()
 Returns whether the animation sequence is currently playing. More...
 
 PlayAnim (boolean play)
 Plays or halts the animation sequence. More...
 
number GetSequNr ()
 Returns the number of the current animation sequence. More...
 
 SetSequNr (number SequNr)
 Sets the sequence number. More...
 
 RestartSequ ()
 Resets the frame counter of the currently playing (or halted) sequence to 0. More...
 
number GetNumSequences ()
 Returns the number (an integer) of animation sequences that are available with this static detail model. More...
 
- Public Member Functions inherited from BaseEntityT
string GetName ()
 Returns the name of this entity. More...
 
x y z GetOrigin ()
 Returns the origin of this entity as a triple of numbers. More...
 
 SetOrigin (number x, number y, number z)
 Sets a new position for this entity. More...
 

Detailed Description

A static detail model.

A static detail model adds geometric detail to a map and can optionally hold a scripted GUI that the user can interact with. Despite its name, a static detail model can run animated sequences, but note that these animations are essentially a client-side effect only, as only a restart of a sequence is sync'ed over the network.

Map Editor Name:
static_detail_model
Implementing C++ Class:
DeathMatch::EntStaticDetailModelT

Member Function Documentation

number GetNumSequences ( )

Returns the number (an integer) of animation sequences that are available with this static detail model.

Example:
-- Set the next sequence number, wrap to 0 after the last.
SDM:SetSequNr((SDM:GetSequNr()+1) % SDM:GetNumSequences())
See http://trac.cafu.de/browser/cafu/trunk/Games/DeathMatch/Worlds/Kidney.lua for another example where the above statement cycles to the next animation sequence in the model every three seconds.
number GetSequNr ( )

Returns the number of the current animation sequence.

Returns
The number (an integer) of the current animation sequence.
boolean IsPlayingAnim ( )

Returns whether the animation sequence is currently playing.

When the animation sequence is playing, the frames of the sequences are advanced over time normally. Otherwise, the animation is halted and kept still.

Returns
true if the animation sequence is playing, false if it is halted.
PlayAnim ( boolean  play)

Plays or halts the animation sequence.

Parameters
playIf true, the animation sequence is played normally. If false, the frames are no longer advanced over time and thus the sequence is kept still.
RestartSequ ( )

Resets the frame counter of the currently playing (or halted) sequence to 0.

SetSequNr ( number  SequNr)

Sets the sequence number.

It also resets the frame counter back to 0, that is, the new sequence is played from the beginning.

Parameters
SequNrThe number of the new animation sequence to use.