Scaling a rigidShape problems
by Azim Palmer · in Torque Game Engine · 07/09/2008 (2:05 am) · 1 replies
When I scale a rigidShape it fairly frequently begins to severly hinder the performance of the engine, is this normal? And if not what am I doing wrong ?
Here is the code I've written that gets called in an onImpact
Here is the code I've written that gets called in an onImpact
function azSphere::expand(%this,%myObj)
{
if (%state == "resting")
{
%state = "expanding";
echo (%this.dump());
}
if(%state == "expanding")
{
if ( %myObj.getScale() < "5.0 5.0 5.0")
{
%myObj.setVelocity("0.0 0.0 0.0");
%curScale = %myObj.getScale();
%addVect = "0.002 0.002 0.002";
%myObj.setScale(VectorAdd(%curScale,%addVect));
%this.schedule(2,expand,%myObj);
}
else
{
%state = "expanded";
}
}
}
Associate Konrad Kiss
Bitgap Games