THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 19:21, xxxxxxxx wrote:
Okay so after doing some more digging in the SDK and some searches here at the cafe, I have found two ways to do the current State To Object.
BaseObject *SpaceRock::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
{
Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA);
if (!dirty) return op->GetCache(hh);
ModelingCommandData mcd;
BaseObject *cube = BaseObject::Alloc(Ocube);
if(!cube) goto Error;
cube->SetParameter(PRIM_CUBE_SUBX, GeData(4),0);
cube->SetParameter(PRIM_CUBE_SUBY, GeData(4),0);
cube->SetParameter(PRIM_CUBE_SUBZ, GeData(4),0);
PolygonObject *polyCube = ToPoly(cube);
if(!polyCube) goto Error;
Vector * points = polyCube->GetPointW();
LONG pointCount = polyCube->GetPointCount();
//mcd.op = polyCube;
//mcd.mode = MODIFY_ALL;
//SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, mcd);
Real arr[20];
InitFbm(arr,10,2.0,0.5);
for (int i = 0; i < pointCount; i++)
{
Real rmf = RidgedMultifractal(arr, points[i], 10, 3, 7) * 5.0;
Real turb = Turbulence(points[i],10, TRUE) * 5.0;
Real snoise = SNoise(points[i]) * 5.0;
Real fbm = Fbm(arr, points[i], 10) * 5.0;
points[i] = points[i] * turb;
points[i] = points[i] * rmf;
points[i] = points[i] * snoise;
points[i] = points[i] * fbm;
}
//CallCommand(12233); //Current State To Object
cube->Message(MSG_UPDATE);
return polyCube;
Error:
return NULL;
}
I have commented both ways out but you can see that I do it with the CallCommand() and I also do it with a SendModelingCommand(). Is there a particularly more effective way to do it? Also, I still must not be doing it correctly, because nothing is happening to my cube. I believe that given the changes I made to the loop that at least something should happen to the points _but nothing is which leads me to believe that it is still not correctly doing the CSTO.
Do you notice anything in particular that I am doing wrong? I will keep looking for more info here and in the SDK as well. Thanks,
~Shawn