objectViewExample doesn't work issue for TGEA 1.7.1 or later version
by ccljyc · in Torque Game Engine Advanced · 03/18/2009 (11:03 pm) · 4 replies
I try to add this before setModel then see the Model shows up
I just try to fix now.
// objectName, shape, skin, detail
view.setObject("SpaceOrc", "~/data/shapes/players/SpaceOrc/SpaceOrc.dts", "", 0);Does any one can full fix it ?I just try to fix now.
#2
03/20/2009 (8:29 pm)
My Scriptview.setObject("SpaceOrc", $defaultGame @ "/data/shapes/players/SpaceOrc/SpaceOrc.dts", "", 0);
view.setModel($defaultGame @ "/data/shapes/players/SpaceOrc/SpaceOrc.dts");
view.loadDSQ("player","~/data/shapes/players/animations/player_root.dsq");The setModel is successful.
#3
and got working.
03/20/2009 (9:52 pm)
I found rename API from GuiObjectViewand got working.
//-----------------------------------------------------------------------------
// Console stuff (GuiObjectView)
//-----------------------------------------------------------------------------
IMPLEMENT_CONOBJECT(GuiObjectView);
ConsoleMethod(GuiObjectView, setModel, void, 3, 3,
"(string shapeName)\n"
"Sets the model to be displayed in this control\n\n"
"\param shapeName Name of the model to display.\n")
{
argc;
object->setObjectModel(argv[2]);
}
ConsoleMethod(GuiObjectView, setSeq, void, 3, 3,
"(int index)\n"
"Sets the animation to play for the viewed object.\n\n"
"\param index The index of the animation to play.")
{
argc;
object->setObjectAnimation(dAtoi(argv[2]));
}
ConsoleMethod(GuiObjectView, setMount, void, 4, 4,
"(string shapeName, int mountPoint)\n"
"Mounts the given model to the specified mount point of the primary model displayed in this control.\n\n"
"\param shapeName Name of the model to mount."
"\param mountPoint Index of the mount point to be mounted to. Corresponds to \"mountPointN\" in your shape where N is the number passed here.")
{
argc;
object->setMountedObject(argv[2], dAtoi(argv[3]));
}
ConsoleMethod(GuiObjectView, setOrbitDistance, void, 3, 3,
"(float distance)\n"
"Sets the distance at which the camera orbits the object. Clamped to the acceptable range defined in the class by min and max orbit distances.\n\n"
"\param distance The distance to set the orbit to (will be clamped).")
{
argc;
object->setOrbitDistance(dAtof(argv[2]));
}
#4
view.setObject doesn't exist, use
view.setModel
12/30/2009 (8:58 am)
Bit of a late reply, but if you're still stuck on this... view.setObject doesn't exist, use
view.setModel
Torque Owner ccljyc