mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
pathshape cleanups and callbacks
sceneObject:
UpdateXformChange(mat); operates on the parent object, so made no sense to shove it in void SceneObject::PerformUpdatesForChildren(MatrixF mat){
provide callbacks for when the parent/child relationship changes
simpath+camerapline+pathshape
provide a mechanism to embed a callback for a pathshape defined on a path node. example:
new Marker() {
seqNum = "7";
hitCommand = "TheCommand" // <------------------------------;
position = "-17.0856 -92.2349 4.00051";
rotation = "0.0334943 -0.254411 0.966516 179.495";
};
function PathShapeData::TheCommand(%this,%obj)
{
echo("Do the thing");
}
This commit is contained in:
parent
f59c5f152f
commit
f4e6060b52
7 changed files with 42 additions and 21 deletions
|
|
@ -76,11 +76,10 @@ PathShape::PathShape()
|
|||
mTarget = 0;
|
||||
mTargetSet = false;
|
||||
|
||||
MatrixF mat(1);
|
||||
mat.setPosition(Point3F(0,0,700));
|
||||
MatrixF mat = MatrixF::Identity;
|
||||
mLastXform = MatrixF::Identity;
|
||||
|
||||
Parent::setTransform(mat);
|
||||
|
||||
mLastXform = mat;
|
||||
for (U32 i = 0; i < 4; i++)
|
||||
{
|
||||
mControl[i] = StringTable->insert("");
|
||||
|
|
@ -350,7 +349,10 @@ void PathShape::popFront()
|
|||
void PathShape::onNode(S32 node)
|
||||
{
|
||||
if (!isGhost())
|
||||
Con::executef(mDataBlock,"onNode",getIdString(), Con::getIntArg(node));
|
||||
{
|
||||
Con::executef(mDataBlock, "onNode", getIdString(), Con::getIntArg(node));
|
||||
Con::executef(mDataBlock, mSpline.getKnot(node)->mHitCommand.c_str(), getIdString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -523,8 +525,8 @@ static CameraSpline::Knot::Path resolveKnotPath(const char *arg)
|
|||
return CameraSpline::Knot::SPLINE;
|
||||
}
|
||||
|
||||
DefineEngineMethod(PathShape, pushBack, void, (TransformF transform, F32 speed, const char* type, const char* path),
|
||||
(TransformF::Identity, 1.0f, "Normal", "Linear"),
|
||||
DefineEngineMethod(PathShape, pushBack, void, (TransformF transform, F32 speed, const char* type, const char* path, const char *hitCommand),
|
||||
(TransformF::Identity, 1.0f, "Normal", "Linear",""),
|
||||
"@brief Adds a new knot to the back of a path camera's path.\n"
|
||||
"@param transform Transform for the new knot. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform()\n"
|
||||
"@param speed Speed setting for this knot.\n"
|
||||
|
|
@ -545,7 +547,7 @@ DefineEngineMethod(PathShape, pushBack, void, (TransformF transform, F32 speed,
|
|||
{
|
||||
QuatF rot(transform.getOrientation());
|
||||
|
||||
object->pushBack(new CameraSpline::Knot(transform.getPosition(), rot, speed, resolveKnotType(type), resolveKnotPath(path)));
|
||||
object->pushBack(new CameraSpline::Knot(transform.getPosition(), rot, speed, resolveKnotType(type), resolveKnotPath(path), String(hitCommand)));
|
||||
}
|
||||
|
||||
DefineEngineMethod(PathShape, pushFront, void, (TransformF transform, F32 speed, const char* type, const char* path),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue