Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::Entity::SplineTrack Class Reference

Inherits G3D::Entity::Track.

Public Member Functions

bool changed () const
 True if setSpline was ever invoked. More...
 
virtual CFrame computeFrame (SimTime time) const override
 
More...
 
void setSpline (const PhysicsFrameSpline &spline)
 
const PhysicsFrameSplinespline () const
 

Static Public Member Functions

static shared_ptr< Trackcreate (Entity *entity, Scene *scene, const Any &a)
 
Creates any of the subclasses described/nested within a. More...
 
static shared_ptr< SplineTrackcreate (const PhysicsFrameSpline &s=PhysicsFrameSpline())
 

Protected Member Functions

 SplineTrack ()
 
 SplineTrack (const Any &a)
 

Static Protected Member Functions

static shared_ptr< Trackcreate (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

bool m_changed
 
PhysicsFrameSpline m_spline
 

Friends

class Entity
 
class Entity::Track
 

Constructor & Destructor Documentation

◆ SplineTrack() [1/2]

G3D::Entity::SplineTrack::SplineTrack ( )
inlineprotected

◆ SplineTrack() [2/2]

G3D::Entity::SplineTrack::SplineTrack ( const Any a)
inlineprotected

Member Function Documentation

◆ changed()

bool G3D::Entity::SplineTrack::changed ( ) const
inline

True if setSpline was ever invoked.

◆ computeFrame()

virtual CFrame G3D::Entity::SplineTrack::computeFrame ( SimTime  time) const
inlineoverridevirtual


Parameters
timeAbsolute simulation time

Implements G3D::Entity::Track.

◆ create() [1/3]

static shared_ptr<Track> G3D::Entity::Track::create ( Entity entity,
Scene scene,
const Any a,
const VariableTable table 
)
staticprotectedinherited

◆ create() [2/3]

static shared_ptr<Track> G3D::Entity::Track::create ( Entity entity,
Scene scene,
const Any a 
)
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())
           );
    }
 

Parameters
entityNeeded to create dependencies in the scene

◆ create() [3/3]

static shared_ptr<SplineTrack> G3D::Entity::SplineTrack::create ( const PhysicsFrameSpline s = PhysicsFrameSpline())
inlinestatic

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ setSpline()

void G3D::Entity::SplineTrack::setSpline ( const PhysicsFrameSpline spline)
inline

◆ spline()

const PhysicsFrameSpline& G3D::Entity::SplineTrack::spline ( ) const
inline

Referenced by setSpline().

Friends And Related Function Documentation

◆ Entity

friend class Entity
friend

◆ Entity::Track

friend class Entity::Track
friend

Member Data Documentation

◆ m_changed

bool G3D::Entity::SplineTrack::m_changed
protected

Referenced by changed(), and setSpline().

◆ m_spline

PhysicsFrameSpline G3D::Entity::SplineTrack::m_spline
protected

Referenced by computeFrame(), setSpline(), and spline().


documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15