Inheritance Graph
graph BT
Behavior
Behavior --> ReferenceCounter
Behavior --> AttributeProvider
AbstractBehaviour --> Behavior
SimplePhysics2 --> Behavior
click Behavior "classMinSG_1_1Behavior"
click ReferenceCounter "classUtil_1_1ReferenceCounter"
click AttributeProvider "classUtil_1_1AttributeProvider"
click AbstractBehaviour "classMinSG_1_1AbstractBehaviour"
click SimplePhysics2 "classMinSG_1_1SimplePhysics2"
Description
Behavior base class.
To start a behavior for an object (without BehaviorManager):
Util::Reference<Behavior> b = new SpecificBehavior; // Create Behavior object (can be used for several objects)
auto status = b->createBehaviorStatus(); // Prepare BehaviorStatus for animated object
Util::requireObjectExtension<BehaviorMyObjectReference>(status)->setMyObject(myObject); // start behavior for the object
while(!status.isFinished()){ // execute until finished
status->getBehavior()->execute( *status.get(), getCurrentTime() );
// ...
}
Note: Use a BehaviorManager for managing behavior statuses.
Public Types
Public Functions
Documentation
enum
MinSG::Behavior::behaviourResult_t
Enumerator |
|
Description |
Enumerator |
|
Description |
CONTINUE |
|
|
FINISHED |
|
|
Defined in MinSG/Core/Behaviours/Behavior.h:47
typedef
MinSG::Behavior::timestamp_t
Defined in MinSG/Core/Behaviours/Behavior.h:46
function
MinSG::Behavior::Behavior
(ctor)
Defined in MinSG/Core/Behaviours/Behavior.h:50
function
MinSG::Behavior::~Behavior
(dtor)
Defined in MinSG/Core/Behaviours/Behavior.h:53
function
MinSG::Behavior::createBehaviorStatus
Defined in MinSG/Core/Behaviours/Behavior.h:55
function
MinSG::Behavior::execute
Defined in MinSG/Core/Behaviours/Behavior.h:56
function
MinSG::Behavior::finalize
Finalize the given BehaviorState.
Note: An already finalized state is silently ignored.
Defined in MinSG/Core/Behaviours/Behavior.h:60