Game Development Community

Set scale of DAE actor?

by Chris · in Torque 3D Professional · 07/24/2010 (6:02 am) · 4 replies

How do I set the scale of a DAE actor when declaring its TSShapeConstructor

#1
07/25/2010 (7:04 am)
Do you mean the scale of an instance of that model (ie. a Player, StaticShape or TSStatic)? If so, you specify it in the World Editor when you instantiate the object, or in the object definition itself. eg.

%player = new Player(MyPlayer)
{
   dataBlock = MyPlayerData;
   scale = "1 1 1";
};

This scale is unique to that object instance, and has nothing to do with TSShapeConstructor.

Or do you mean the COLLADA <unit> element scale (effectively a global scaler applied to the entire object on import)? If so, just set the 'unit' field of the TSShapeConstructor object (or in the COLLADA import gui when you first import the model). eg.

singleton TSShapeConstructor(MyModelDae)
{
   baseShape = "./myModel.dae";
   unit = "0.1";
};

This scale factor is applied when the DAE is loaded, and will therefore affect all instances of the model.
#2
07/25/2010 (8:10 am)
edit : I got it
#3
07/25/2010 (8:56 am)
Scale seems to work.

Unit does not seem to do anything. Here is how my shape is setup

singleton TSShapeConstructor(IceHumanMale_Shape)
{
baseShape = "./Human_Male.dts";
unit="0.01";
};

vs

singleton TSShapeConstructor(IceHumanMale_Shape)
{
baseShape = "./Human_Male.dts";
unit="3";
};


#4
07/25/2010 (10:11 pm)
The TSShapeConstructor unit scale is only applied when the DAE is imported, so you may have to delete the cached.dts first (the scale will then be baked into the cached.dts file).

You can find more information about the COLLADA unit scale factor here.