| Support Forum G3D Web Page |
Inherits G3D::Entity::Track.
Public Member Functions | |
| const CFrame & | childFrame () const |
| virtual CFrame | computeFrame (SimTime time) const override |
More... | |
| const String & | entityName () const |
| The entity cannot be changed once the track is created, but the relative frame may be changed. More... | |
| void | setChildFrame (const CFrame &frame) |
Static Public Member Functions | |
| static shared_ptr< Track > | create (Entity *entity, Scene *scene, const Any &a) |
Creates any of the subclasses described/nested within a. More... | |
| static shared_ptr< EntityTrack > | create (Entity *entity, const String &nameOfEntityToFollow, Scene *scene, const CFrame &childFrame=CFrame()) |
Protected Member Functions | |
| EntityTrack (Entity *entity, const String &n, Scene *scene, const CFrame &frame) | |
Static Protected Member Functions | |
| static shared_ptr< Track > | create (Entity *entity, Scene *scene, const Any &a, const VariableTable &table) |
| template<class T , class ... ArgTypes> | |
| static shared_ptr< T > | createShared (ArgTypes &&... args) |
| Like std::make_shared, but works for protected constructors. More... | |
Protected Attributes | |
| CFrame | m_childFrame |
| const String | m_entityName |
| Scene * | m_scene |
|
protected |
| const CFrame& G3D::Entity::EntityTrack::childFrame | ( | ) | const |
|
staticprotectedinherited |
|
staticinherited |
Creates any of the subclasses described/nested within a.
Grammar:
ctrl :=
"Point3(...)" |
"CFrame..." |
"Matrix3..." |
"PhysicsFrameSpline { ... }" |
"timeShift( splineTrack or orbitTrack, deltaTime)" |
// Use the current position of this entity; creates a depends-on relationship.
// optional cframe is equivalent to the common idiom "transform(entity(...), cframe)"
"entity(\"entityname\" [, cframe:<CFrame>])" |
// use a * b
"transform( a:<ctrl>, b:<ctrl> )" |
// attach to <ctrl> by a spring; creates a depends-on relationship...reserved for future use
"follow( <ctrl>, ? )" |
// Rotate to base to look at target's origin
"lookAt( base:<ctrl>, target:<ctrl> [, up:<Vector3>] )" |
// Strip the rotation from one track and the translation from another
"combine(rot:<ctrl>, trans:<ctrl>)" |
// Rotate around Y axis, facing forward on the track (use combine or transform to alter, use radius 0 to spin in place)
"orbit(radius, period)" |
// name to be bound by a WITH expression
"<id>" |
// Bind the ids to controllers (in the previous variable environment), and then evaluate another one
"with({ [<id> = <ctrl>]* }, <ctrl> )"
Example:
VisibleEntity {
...
controller =
with({
target = entity("mothership");
spline = PhysicsFrameSpline { .... };
},
// Lead the target by looking ahead of it in object space
lookAt(spline, transform(target, Matrix4::translation(0, 0, -3)), Vector3::unitY())
);
}
| entity | Needed to create dependencies in the scene |
|
static |
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
| const String& G3D::Entity::EntityTrack::entityName | ( | ) | const |
The entity cannot be changed once the track is created, but the relative frame may be changed.
| void G3D::Entity::EntityTrack::setChildFrame | ( | const CFrame & | frame | ) |
|
protected |
|
protected |
|
protected |
1.8.15