shapeBase.cpp
Engine/source/T3D/shapeBase.cpp
Classes:
class
Public Variables
Public Functions
ConsoleDocClass(ShapeBase , "@ingroup gameObjects" )
ConsoleDocClass(ShapeBaseData , "@brief Defines properties <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> a <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )
DefineEngineMethod(ShapeBase , applyDamage , void , (F32 amount) , "@brief Increment the current damage level by the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "@param amount value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" )
DefineEngineMethod(ShapeBase , applyImpulse , bool , (Point3F pos, Point3F vec) , "@brief Apply an impulse <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param pos world position of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">impulse\n</a>" "@param vec impulse momentum (velocity * mass)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n\n</a>" )
DefineEngineMethod(ShapeBase , applyRepair , void , (F32 amount) , "@brief Repair damage by the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "Note that the damage level is only reduced by repairRate per tick, so it may " "take several ticks <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the total repair <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">complete.\n</a>" " @param amount total repair value(subtracted from damage level over time)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , blowUp , void , () , "@brief Explodes an object into pieces." )
DefineEngineMethod(ShapeBase , canCloak , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object can <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cloak.\n\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n</a>" "@note Not implemented as it always returns true." )
DefineEngineMethod(ShapeBase , changeMaterial , void , (const char *mapTo, Material *oldMat, Material *newMat) , "@brief Change one of the materials on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "This method changes materials per mapTo with others. The material that " "is being replaced is mapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> unmapped_mat as a part of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transition.\n</a>" "@note Warning)
DefineEngineMethod(ShapeBase , destroyThread , bool , (S32 slot) , "@brief Destroy an animation thread, which prevents it from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing.\n\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">destroy\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , dumpMeshVisibility , void , () , "@brief Print a list of visible and hidden meshes in the shape <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the console " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> debugging <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">purposes.\n\n</a>" "@note Only in a SHIPPING <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">build.\n</a>" )
DefineEngineMethod(ShapeBase , getAIRepairPoint , Point3F , () , "@brief Get the position at which the AI should stand <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">things.\n\n</a>" "If the shape defines a node called \"AIRepairNode\" , this method will " "return the current world position of that node, otherwise \"0 0 0\".\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the AI repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position\n\n</a>" )
DefineEngineMethod(ShapeBase , getCameraFov , F32 , () , "@brief Returns the vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@return current FOV as defined in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData::cameraDefaultFov\n</a>" )
DefineEngineMethod(ShapeBase , getControllingClient , S32 , () , "@brief Get the client (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> any) that controls this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "The controlling client is the one that will send moves <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> us <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> act <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n</a>" "@return the ID of the controlling GameConnection, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is not " "controlled by any <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">client.\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GameConnection\n</a>" )
DefineEngineMethod(ShapeBase , getControllingObject , S32 , () , "@brief Get the object (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> any) that controls this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@return the ID of the controlling <a href="/coding/class/classshapebase/">ShapeBase</a> object, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is " "not controlled by another <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" )
DefineEngineMethod(ShapeBase , getDamageFlash , F32 , () , "@brief Get the damage flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setDamageFlash\n</a>" )
DefineEngineMethod(ShapeBase , getDamageLevel , F32 , () , "@brief Get the object's current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see setDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDamagePercent , F32 , () , "@brief Get the object's current damage level as a percentage of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">maxDamage.\n\n</a>" "@return damageLevel / <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxDamage\n</a>" "@see setDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDamageState , const char * , () , "@brief Get the object's damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return the damage state; one of \"Enabled\" , \"Disabled\" , \"Destroyed\"\n" "@see setDamageState()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDefaultCameraFov , F32 , () , "@brief Returns the default vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@return Default <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FOV\n</a>" )
DefineEngineMethod(ShapeBase , getEnergyLevel , F32 , () , "@brief Get the object's current energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see setEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getEnergyPercent , F32 , () , "@brief Get the object's current energy level as a percentage of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">maxEnergy.\n\n</a>" "@return energyLevel / <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxEnergy\n</a>" "@see setEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getEyePoint , Point3F , () , "@brief Get the position of the 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current world position, otherwise it will return the object 's current " "world <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position.\n</a>" " @return the eye position <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeVector\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeTransform\n</a>" )
DefineEngineMethod(ShapeBase , getEyeTransform , TransformF , () , "@brief Get the 'eye' transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current transform, otherwise it will return the object 's current " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform.\n</a>" " @return the eye transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeVector\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyePoint\n</a>" )
DefineEngineMethod(ShapeBase , getEyeVector , VectorF , () , "@brief Get the forward direction of the 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current forward direction vector, otherwise it will return the " "object 's current forward direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector.\n</a>" " @return the eye vector <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyePoint\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeTransform\n</a>" )
DefineEngineMethod(ShapeBase , getImageAltTrigger , bool , (S32 slot) , "@brief Get the alt trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current alt trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageAmmo , bool , (S32 slot) , "@brief Get the ammo state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current ammo <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageGenericTrigger , bool , (S32 slot, S32 trigger) , "@brief Get the generic trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param trigger Generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n</a>" "@return the Image's current generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageLoaded , bool , (S32 slot) , "@brief Get the loaded state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current loaded <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageScriptAnimPrefix , const char * , (S32 slot) , "@brief Get the script animation prefix of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current script animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">prefix\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageSkinTag , S32 , (S32 slot) , "@brief Get the skin tag ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the skinTag value passed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mountImage when the image was " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mounted\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageState , const char * , (S32 slot) , "@brief Get the name of the current state of the Image in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return name of the current Image state, or \"Error\" if slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageTarget , bool , (S32 slot) , "@brief Get the target state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current target <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageTrigger , bool , (S32 slot) , "@brief Get the trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getLookAtPoint , const char * , (F32 distance, S32 typeMask) , (2000, 0xFFFFFFFF) )
DefineEngineMethod(ShapeBase , getMaxDamage , F32 , () , "Get the object's maxDamage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxDamage\n</a>" )
DefineEngineMethod(ShapeBase , getModelFile , const char * , () , "@brief Get the model filename used by this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename\n\n</a>" )
DefineEngineMethod(ShapeBase , getMountedImage , S32 , (S32 slot) , "@brief Get the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return ID of the <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock mounted in the slot, or 0 " "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> no Image is mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">there.\n\n</a>" )
DefineEngineMethod(ShapeBase , getMountSlot , S32 , (ShapeBaseImageData *image) , "@brief Get the first slot the given datablock is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param image <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return index of the first slot the Image is mounted in, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image " "is not mounted in any slot on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" )
DefineEngineMethod(ShapeBase , getMuzzlePoint , Point3F , (S32 slot) , "@brief Get the muzzle position of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "If the Image shape contains a node called 'muzzlePoint' , then the muzzle " "position is the position of that node in world space. If no such node " "is specified, the slot 's mount node is used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">instead.\n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return the muzzle position, or \"0 0 0\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getMuzzleVector , VectorF , (S32 slot) , "@brief Get the muzzle vector of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "If the Image shape contains a node called 'muzzlePoint' , then the muzzle " "vector is the forward direction vector of that node 's transform in world " "space. If no such node is specified, the slot 's mount node is used " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">instead.\n\n</a>" "If the correctMuzzleVector flag(correctMuzzleVectorTP in 3rd person) " "is set in the Image, the muzzle vector is computed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> point at whatever " "object is right in front of the object 's 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return the muzzle vector, or \"0 1 0\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getPendingImage , S32 , (S32 slot) , "@brief Get the Image that will be mounted next in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "Calling mountImage when an Image is already mounted does one of two things: " "<ol><li>Mount the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> Image immediately, the old Image is discarded and " "whatever state it was in is ignored.</li >" "< li >If the current Image state does not allow Image changes, the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> " "Image is marked as pending, and will not be mounted until the current " "state completes. eg. <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the user changes weapons, you may wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> ensure " "that the current weapon firing state plays <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> completion first.</li ></ol >\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "This command retrieves the ID of the pending Image(2nd case above).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return ID of the pending <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">none.\n\n</a>" )
DefineEngineMethod(ShapeBase , getRechargeRate , F32 , () , "@brief Get the current recharge <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rate.\n\n</a>" "@return the recharge rate (per tick)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see setRechargeRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getRepairRate , F32 , () , "@brief Get the per-tick repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "@return the current value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be subtracted from damage level each <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tick\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setRepairRate\n</a>" )
DefineEngineMethod(ShapeBase , getShapeName , const char * , () , "@brief Get the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@note This is the name of the shape object that is sent <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the client, " "not the DTS or DAE model <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n</a>" " @return the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" " @see setShapeName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getSkinName , const char * , () , "@brief Get the name of the skin applied <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n</a>" "@see setSkinName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getSlotTransform , TransformF , (S32 slot) , "@brief Get the world transform of the specified mount <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the mount <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform\n\n</a>" )
DefineEngineMethod(ShapeBase , getTargetCount , S32 , () , "@brief Get the number of materials in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the number of materials in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@see getTargetName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getTargetName , const char * , (S32 index) , "@brief Get the name of the indexed shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material.\n\n</a>" "@param index index of the material <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get (valid range is 0 - getTargetCount()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material.\n\n</a>" "@see getTargetCount()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getVelocity , VectorF , () , "@brief Get the object's current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity.\n\n</a>" "@return the current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity\n\n</a>" )
DefineEngineMethod(ShapeBase , getWhiteOut , F32 , () , "@brief Get the white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setWhiteOut\n</a>" )
DefineEngineMethod(ShapeBase , hasImageState , bool , (S32 slot, const char *state) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the given state exists on the mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param state Image state <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">for\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image has the requested state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">defined.\n\n</a>" )
DefineEngineMethod(ShapeBase , isCloaked , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cloaked.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> cloaked, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see setCloaked()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isDestroyed , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Destroyed damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is \"Destroyed\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see isDisabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isEnabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isDisabled , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Disabled or Destroyed damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is not \"Enabled\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> it <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">is\n</a>" " @see isDestroyed()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isEnabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isEnabled , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Enabled damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is \"Enabled\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see isDestroyed()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isDisabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isHidden , bool , () , "Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hidden.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is hidden, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">visible.\n\n</a>" )
DefineEngineMethod(ShapeBase , isImageFiring , bool , (S32 slot) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the current Image state is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">firing.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the current Image state in this slot has the 'stateFire' flag <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">set.\n</a>" )
DefineEngineMethod(ShapeBase , isImageMounted , bool , (ShapeBaseImageData *image) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the given datablock is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any slot on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param image <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any slot, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" )
DefineEngineMethod(ShapeBase , mountImage , bool , (ShapeBaseImageData *image, S32 slot, bool loaded, const char *skinTag) , (true, "") , "@brief Mount a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image.\n\n</a>" "@param image the Image <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mount\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mount into (valid range is 0 - 3)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param loaded initial loaded state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@param skinTag tagged string <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> reskin the mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%player.mountImage(PistolImage, 1);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%player.mountImage(CrossbowImage, 0, false);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%player.mountImage(RocketLauncherImage, 0, true, 'blue');\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" " @see unmountImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getMountedImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getPendingImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isImageMounted()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , pauseThread , bool , (S32 slot) , "@brief Pause an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "If restarted using playThread, the animation " "will resume from the paused <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position.\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stop\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , playAudio , bool , (S32 slot, SFXTrack *track) , "@brief Attach a sound <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this shape and start playing <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it.\n\n</a>" "@param slot Audio slot index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the sound (valid range is 0 - 3)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param track <a href="/coding/class/classsfxtrack/">SFXTrack</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">play\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the sound was attached successfully, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see stopAudio()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , playThread , bool , (S32 slot, const char *name) , ("") , "@brief Start a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> animation thread, or restart one that has been paused or " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stopped.\n\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play. Valid range is 0 - 3)
DefineEngineMethod(ShapeBase , setAllMeshesHidden , void , (bool hide) , "@brief Set the hidden state on all the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">meshes.\n\n</a>" "This allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide all meshes in the shape, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> example, and then only " "enable a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">few.\n</a>" " @param hide <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> hidden state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">meshes\n\n</a>" )
DefineEngineMethod(ShapeBase , setCameraFov , void , (F32 fov) , "@brief Set the vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@param fov <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> FOV <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" )
DefineEngineMethod(ShapeBase , setCloaked , void , (bool cloak) , "@brief Set the cloaked state of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "When an object is cloaked it is not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendered.\n</a>" "@param cloak true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> cloak the object, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloak\n</a>" " @see isCloaked()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageFlash , void , (F32 level) , "@brief Set the damage flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "Damage flash may be used as a postfx effect <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> flash the screen when the " "client is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">damaged.\n</a>" "@note Relies on the flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">postFx.\n</a>" "@param level flash level (0-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getDamageFlash()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageLevel , void , (F32 level) , "@brief Set the object's current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@param level <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see getDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getDamagePercent()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageState , bool , (const char *state) , "@brief Set the object's damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@param state should be one of \"Enabled\" , \"Disabled\" , \"Destroyed\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n</a>" " @see getDamageState()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageVector , void , (Point3F vec) , "@brief Set the damage direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector.\n\n</a>" "Currently this is only used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> initialise the explosion <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object " "is blown <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">up.\n</a>" "@param vec damage direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%obj.setDamageVector( \"0 0 1\" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineEngineMethod(ShapeBase , setEnergyLevel , void , (F32 level) , "@brief Set this object's current energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@param level <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see getEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getEnergyPercent()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setHidden , void , (bool show) , "@brief Add or remove this object from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n\n</a>" "When removed from the scene, the object will not be processed or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendered.\n</a>" " @param show False <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide the object, true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> re-show <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageAltTrigger , bool , (S32 slot, bool state) , "@brief Set the alt trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> alt trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> alt trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageAmmo , bool , (S32 slot, bool state) , "@brief Set the ammo state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> ammo state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> ammo <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageGenericTrigger , S32 , (S32 slot, S32 trigger, bool state) , "@brief Set the generic trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param trigger Generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> generic trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> generic trigger state or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there was a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">problem.\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageLoaded , bool , (S32 slot, bool state) , "@brief Set the loaded state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> loaded state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> loaded <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageScriptAnimPrefix , void , (S32 slot, const char *prefix) , "@brief Set the script animation prefix <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "This is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> further modify the prefix used when deciding which animation sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "play <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> this image is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mounted.\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param prefix The prefix applied <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">image\n</a>" )
DefineEngineMethod(ShapeBase , setImageTarget , bool , (S32 slot, bool state) , "@brief Set the target state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> target state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> target <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageTrigger , bool , (S32 slot, bool state) , "@brief Set the trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setMeshHidden , void , (const char *name, bool hide) , "@brief Set the hidden state on the named shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n\n</a>" "@param name name of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">show\n</a>" "@param hide <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> hidden state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh\n\n</a>" )
DefineEngineMethod(ShapeBase , setRechargeRate , void , (F32 rate) , "@brief Set the recharge <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rate.\n\n</a>" "The recharge rate is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the object's current energy level each tick, " "up <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the maxEnergy level set in the <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.\n</a>" " @param rate the recharge rate(per tick)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getRechargeRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setRepairRate , void , (F32 rate) , "@brief Set amount <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> repair damage by each <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tick.\n\n</a>" "Note that this value is separate <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the repairRate field in ShapeBaseData. " "This value will be subtracted from the damage level each tick, whereas the " "<a href="/coding/class/structshapebasedata/">ShapeBaseData</a> field limits how much of the applyRepair value is subtracted " "each tick. Both repair types can be active at the same <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">time.\n</a>" " @param rate value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> subtract from damage level each tick(must be > 0)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getRepairRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setShapeName , void , (const char *name) , "@brief Set the name of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@note This is the name of the shape object that is sent <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the client, " "not the DTS or DAE model <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n</a>" " @param name <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" " @see getShapeName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setSkinName , void , (const char *name) , "@brief Apply a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> skin <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "'Skinning' the shape effectively renames the material targets, allowing " "different materials <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be used on different instances of the same <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">model.\n\n</a>" " @param name name of the skin <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">apply\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n</a>" " @see getSkinName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setThreadDir , bool , (S32 slot, bool fwd) , "@brief Set the playback direction of an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param fwd true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play the animation forwards, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">backwards\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see playThread()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setThreadPosition , bool , (S32 slot, F32 pos) , "@brief Set the position within an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param pos position within <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , setThreadTimeScale , bool , (S32 slot, F32 scale) , "@brief Set the playback time scale of an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param scale <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> thread time scale (1=normal speed, 0.5=half speed etc)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , setVelocity , bool , (Point3F vel) , "@brief Set the object's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity.\n\n</a>" "@param vel <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> velocity <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n\n</a>" )
DefineEngineMethod(ShapeBase , setWhiteOut , void , (F32 level) , "@brief Set the white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "White-out may be used as a postfx effect <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> brighten the screen in response " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> a game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">event.\n</a>" "@note Relies on the flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">postFx.\n</a>" "@param level flash level (0-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getWhiteOut()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , startFade , void , (S32 time, S32 delay, bool fadeOut) , "@brief Fade the object in or out without removing it from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n\n</a>" "A faded out object is still in the scene and can still be collided with, " "so <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> you want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> disable collisions <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this shape after it fades out " "use setHidden <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> temporarily remove this shape from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n</a>" " @note Items have the ability <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> light their surroundings. When an <a href="/coding/class/classitem/">Item</a> with " "an active light is fading out, the light it emits is correspondingly " "reduced until it goes out. Likewise, when the item fades in, the light is " "turned-up till it reaches it 's normal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">brightntess.\n</a>" " @param time duration of the fade effect in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ms\n</a>" " @param delay delay in ms before the fade effect <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">begins\n</a>" " @param fadeOut true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> fade-out <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> invisible, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> fade-in <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> full <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">visibility\n</a>" )
DefineEngineMethod(ShapeBase , stopAudio , bool , (S32 slot) , "@brief Stop a sound started with <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playAudio.\n\n</a>" "@param slot audio slot index (started with playAudio)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the sound was stopped successfully, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see playAudio()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , stopThread , bool , (S32 slot) , "@brief Stop an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "If restarted using playThread, the animation " "will start from the beginning <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">again.\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stop\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , unmountImage , bool , (S32 slot) , "@brief Unmount the mounted Image in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unmount\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see mountImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBaseData , checkDeployPos , bool , (TransformF txfm) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there is the space at the given transform is free <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> spawn <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">into.\n\n</a>" "The shape's bounding box volume is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> collisions at the given world " "transform. Only interior and static objects are checked <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">collision.\n</a>" "@param txfm Deploy transform <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the space is free, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there is already something in " "the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">way.\n</a>" " @note This is a server side only check, and is not actually limited <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawning.\n</a>" )
DefineEngineMethod(ShapeBaseData , getDeployTransform , TransformF , (Point3F pos, Point3F normal) , "@brief Helper method <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get a transform from a position and vector (suitable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> use with setTransform).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@param pos Desired transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position\n</a>" "@param normal <a href="/coding/class/classvector/">Vector</a> of desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">direction\n</a>" "@return The deploy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform\n</a>" )
IMPLEMENT_CALLBACK(ShapeBase , validateCameraFov , F32 , (F32 fov) , (fov) , "@brief Called on the server when the client has requested a FOV <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">change.\n\n</a>" "When the client requests that its field of view should be changed (because " "they want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use a sniper scope, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> example) this <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> FOV needs <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be validated " "by the server. This method is called <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> it exists (it is optional) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> validate " "the requested FOV, and modify it <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> necessary. This could be as simple as checking " "that the FOV falls within a correct range, <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> making sure that the FOV matches the " "capabilities of the current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">weapon.\n\n</a>" "Following this method, <a href="/coding/class/classshapebase/">ShapeBase</a> ensures that the given FOV still falls within " "the datablock 's cameraMinFov and cameraMaxFov. If that is good enough <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> your " " purposes, then you do not need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> define the validateCameraFov() callback <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "your <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase.\n\n</a>" " @param fov The FOV that has been requested by the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">client.\n</a>" " @return The FOV as validated by the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">server.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData\n\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onCollision , void , (ShapeBase *obj, SceneObject *collObj, VectorF vec, F32 len) , (obj, collObj, vec, len) , "@brief Called when we collide with another <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param collObj The object we collided <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">with\n</a>" "@param vec <a href="/coding/class/structcollision/">Collision</a> impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1afed088663f8704004425cdae2120b9b3">len</a> Length of the impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onDamage , void , (ShapeBase *obj, F32 delta) , (obj, delta) , "@brief Called when the object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">damaged.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param delta The amount of damage received." )
IMPLEMENT_CALLBACK(ShapeBaseData , onDestroyed , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Destroyed.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onDisabled , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Disabled.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onEnabled , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Enabled.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onEndSequence , void , (ShapeBase *obj, S32 slot, const char *name) , (obj, slot, name) , "@brief Called when a thread playing a non-cyclic sequence reaches the end of the " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param slot <a href="/coding/class/classthread/">Thread</a> slot that finished <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing\n</a>" "@param name <a href="/coding/class/classthread/">Thread</a> name that finished <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onForceUncloak , void , (ShapeBase *obj, const char *reason) , (obj, reason) , "@brief Called when the object is forced <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloak.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param reason <a href="/coding/class/classstring/">String</a> describing why the object was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloaked\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onImpact , void , (ShapeBase *obj, SceneObject *collObj, VectorF vec, F32 len) , (obj, collObj, vec, len) , "@brief Called when we collide with another object beyond some impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">speed.\n\n</a>" "The <a href="/coding/class/classplayer/">Player</a> class makes use of this callback when a collision speed is more than <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">PlayerData::minImpactSpeed.\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param collObj The object we collided <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">with\n</a>" "@param vec <a href="/coding/class/structcollision/">Collision</a> impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1afed088663f8704004425cdae2120b9b3">len</a> Length of the impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onTrigger , void , (ShapeBase *obj, S32 index, bool state) , (obj, index, state) , "@brief Called when a move trigger input changes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param index Index of the trigger that <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">changed\n</a>" "@param state New state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" )
Detailed Description
Public Variables
ShapeBaseDataProto gShapeBaseDataProto
SimTime sAudioTimeout
const char * sDamageStateName []
Chunker< ShapeBase::CollisionTimeout > sTimeoutChunker
Public Functions
ConsoleDocClass(ShapeBase , "@ingroup gameObjects" )
ConsoleDocClass(ShapeBaseData , "@brief Defines properties <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> a <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )
DefineEngineMethod(ShapeBase , applyDamage , void , (F32 amount) , "@brief Increment the current damage level by the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "@param amount value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" )
DefineEngineMethod(ShapeBase , applyImpulse , bool , (Point3F pos, Point3F vec) , "@brief Apply an impulse <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param pos world position of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">impulse\n</a>" "@param vec impulse momentum (velocity * mass)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n\n</a>" )
DefineEngineMethod(ShapeBase , applyRepair , void , (F32 amount) , "@brief Repair damage by the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "Note that the damage level is only reduced by repairRate per tick, so it may " "take several ticks <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the total repair <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">complete.\n</a>" " @param amount total repair value(subtracted from damage level over time)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , blowUp , void , () , "@brief Explodes an object into pieces." )
DefineEngineMethod(ShapeBase , canCloak , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object can <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cloak.\n\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n</a>" "@note Not implemented as it always returns true." )
DefineEngineMethod(ShapeBase , changeMaterial , void , (const char *mapTo, Material *oldMat, Material *newMat) , "@brief Change one of the materials on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "This method changes materials per mapTo with others. The material that " "is being replaced is mapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> unmapped_mat as a part of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transition.\n</a>" "@note Warning)
DefineEngineMethod(ShapeBase , destroyThread , bool , (S32 slot) , "@brief Destroy an animation thread, which prevents it from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing.\n\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">destroy\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , dumpMeshVisibility , void , () , "@brief Print a list of visible and hidden meshes in the shape <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the console " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> debugging <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">purposes.\n\n</a>" "@note Only in a SHIPPING <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">build.\n</a>" )
DefineEngineMethod(ShapeBase , getAIRepairPoint , Point3F , () , "@brief Get the position at which the AI should stand <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">things.\n\n</a>" "If the shape defines a node called \"AIRepairNode\" , this method will " "return the current world position of that node, otherwise \"0 0 0\".\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the AI repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position\n\n</a>" )
DefineEngineMethod(ShapeBase , getCameraFov , F32 , () , "@brief Returns the vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@return current FOV as defined in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData::cameraDefaultFov\n</a>" )
DefineEngineMethod(ShapeBase , getControllingClient , S32 , () , "@brief Get the client (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> any) that controls this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "The controlling client is the one that will send moves <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> us <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> act <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n</a>" "@return the ID of the controlling GameConnection, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is not " "controlled by any <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">client.\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GameConnection\n</a>" )
DefineEngineMethod(ShapeBase , getControllingObject , S32 , () , "@brief Get the object (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> any) that controls this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@return the ID of the controlling <a href="/coding/class/classshapebase/">ShapeBase</a> object, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is " "not controlled by another <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" )
DefineEngineMethod(ShapeBase , getDamageFlash , F32 , () , "@brief Get the damage flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setDamageFlash\n</a>" )
DefineEngineMethod(ShapeBase , getDamageLevel , F32 , () , "@brief Get the object's current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see setDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDamagePercent , F32 , () , "@brief Get the object's current damage level as a percentage of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">maxDamage.\n\n</a>" "@return damageLevel / <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxDamage\n</a>" "@see setDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDamageState , const char * , () , "@brief Get the object's damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return the damage state; one of \"Enabled\" , \"Disabled\" , \"Destroyed\"\n" "@see setDamageState()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getDefaultCameraFov , F32 , () , "@brief Returns the default vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@return Default <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FOV\n</a>" )
DefineEngineMethod(ShapeBase , getEnergyLevel , F32 , () , "@brief Get the object's current energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see setEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getEnergyPercent , F32 , () , "@brief Get the object's current energy level as a percentage of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">maxEnergy.\n\n</a>" "@return energyLevel / <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxEnergy\n</a>" "@see setEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getEyePoint , Point3F , () , "@brief Get the position of the 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current world position, otherwise it will return the object 's current " "world <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position.\n</a>" " @return the eye position <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeVector\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeTransform\n</a>" )
DefineEngineMethod(ShapeBase , getEyeTransform , TransformF , () , "@brief Get the 'eye' transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current transform, otherwise it will return the object 's current " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform.\n</a>" " @return the eye transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeVector\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyePoint\n</a>" )
DefineEngineMethod(ShapeBase , getEyeVector , VectorF , () , "@brief Get the forward direction of the 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "If the object model has a node called 'eye' , this method will return that " "node 's current forward direction vector, otherwise it will return the " "object 's current forward direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector.\n</a>" " @return the eye vector <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyePoint\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">getEyeTransform\n</a>" )
DefineEngineMethod(ShapeBase , getImageAltTrigger , bool , (S32 slot) , "@brief Get the alt trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current alt trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageAmmo , bool , (S32 slot) , "@brief Get the ammo state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current ammo <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageGenericTrigger , bool , (S32 slot, S32 trigger) , "@brief Get the generic trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param trigger Generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n</a>" "@return the Image's current generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageLoaded , bool , (S32 slot) , "@brief Get the loaded state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current loaded <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageScriptAnimPrefix , const char * , (S32 slot) , "@brief Get the script animation prefix of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current script animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">prefix\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageSkinTag , S32 , (S32 slot) , "@brief Get the skin tag ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the skinTag value passed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mountImage when the image was " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mounted\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageState , const char * , (S32 slot) , "@brief Get the name of the current state of the Image in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return name of the current Image state, or \"Error\" if slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageTarget , bool , (S32 slot) , "@brief Get the target state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current target <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getImageTrigger , bool , (S32 slot) , "@brief Get the trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the Image's current trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , getLookAtPoint , const char * , (F32 distance, S32 typeMask) , (2000, 0xFFFFFFFF) )
DefineEngineMethod(ShapeBase , getMaxDamage , F32 , () , "Get the object's maxDamage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.maxDamage\n</a>" )
DefineEngineMethod(ShapeBase , getModelFile , const char * , () , "@brief Get the model filename used by this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename\n\n</a>" )
DefineEngineMethod(ShapeBase , getMountedImage , S32 , (S32 slot) , "@brief Get the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return ID of the <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock mounted in the slot, or 0 " "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> no Image is mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">there.\n\n</a>" )
DefineEngineMethod(ShapeBase , getMountSlot , S32 , (ShapeBaseImageData *image) , "@brief Get the first slot the given datablock is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param image <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return index of the first slot the Image is mounted in, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image " "is not mounted in any slot on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" )
DefineEngineMethod(ShapeBase , getMuzzlePoint , Point3F , (S32 slot) , "@brief Get the muzzle position of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "If the Image shape contains a node called 'muzzlePoint' , then the muzzle " "position is the position of that node in world space. If no such node " "is specified, the slot 's mount node is used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">instead.\n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return the muzzle position, or \"0 0 0\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getMuzzleVector , VectorF , (S32 slot) , "@brief Get the muzzle vector of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "If the Image shape contains a node called 'muzzlePoint' , then the muzzle " "vector is the forward direction vector of that node 's transform in world " "space. If no such node is specified, the slot 's mount node is used " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">instead.\n\n</a>" "If the correctMuzzleVector flag(correctMuzzleVectorTP in 3rd person) " "is set in the Image, the muzzle vector is computed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> point at whatever " "object is right in front of the object 's 'eye' <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return the muzzle vector, or \"0 1 0\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the slot is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">invalid\n\n</a>" )
DefineEngineMethod(ShapeBase , getPendingImage , S32 , (S32 slot) , "@brief Get the Image that will be mounted next in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "Calling mountImage when an Image is already mounted does one of two things: " "<ol><li>Mount the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> Image immediately, the old Image is discarded and " "whatever state it was in is ignored.</li >" "< li >If the current Image state does not allow Image changes, the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> " "Image is marked as pending, and will not be mounted until the current " "state completes. eg. <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the user changes weapons, you may wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> ensure " "that the current weapon firing state plays <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> completion first.</li ></ol >\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "This command retrieves the ID of the pending Image(2nd case above).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return ID of the pending <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock, or 0 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">none.\n\n</a>" )
DefineEngineMethod(ShapeBase , getRechargeRate , F32 , () , "@brief Get the current recharge <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rate.\n\n</a>" "@return the recharge rate (per tick)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see setRechargeRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getRepairRate , F32 , () , "@brief Get the per-tick repair <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">amount.\n\n</a>" "@return the current value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be subtracted from damage level each <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tick\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setRepairRate\n</a>" )
DefineEngineMethod(ShapeBase , getShapeName , const char * , () , "@brief Get the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@note This is the name of the shape object that is sent <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the client, " "not the DTS or DAE model <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n</a>" " @return the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" " @see setShapeName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getSkinName , const char * , () , "@brief Get the name of the skin applied <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n</a>" "@see setSkinName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getSlotTransform , TransformF , (S32 slot) , "@brief Get the world transform of the specified mount <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the mount <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform\n\n</a>" )
DefineEngineMethod(ShapeBase , getTargetCount , S32 , () , "@brief Get the number of materials in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@return the number of materials in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@see getTargetName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getTargetName , const char * , (S32 index) , "@brief Get the name of the indexed shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material.\n\n</a>" "@param index index of the material <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get (valid range is 0 - getTargetCount()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material.\n\n</a>" "@see getTargetCount()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , getVelocity , VectorF , () , "@brief Get the object's current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity.\n\n</a>" "@return the current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity\n\n</a>" )
DefineEngineMethod(ShapeBase , getWhiteOut , F32 , () , "@brief Get the white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@return white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">setWhiteOut\n</a>" )
DefineEngineMethod(ShapeBase , hasImageState , bool , (S32 slot, const char *state) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the given state exists on the mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param state Image state <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">for\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image has the requested state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">defined.\n\n</a>" )
DefineEngineMethod(ShapeBase , isCloaked , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cloaked.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> cloaked, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see setCloaked()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isDestroyed , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Destroyed damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is \"Destroyed\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see isDisabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isEnabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isDisabled , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Disabled or Destroyed damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is not \"Enabled\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> it <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">is\n</a>" " @see isDestroyed()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isEnabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isEnabled , bool , () , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is in the Enabled damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> damage state is \"Enabled\" , false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n</a>" " @see isDestroyed()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isDisabled()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , isHidden , bool , () , "Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hidden.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the object is hidden, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">visible.\n\n</a>" )
DefineEngineMethod(ShapeBase , isImageFiring , bool , (S32 slot) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the current Image state is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">firing.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the current Image state in this slot has the 'stateFire' flag <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">set.\n</a>" )
DefineEngineMethod(ShapeBase , isImageMounted , bool , (ShapeBaseImageData *image) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the given datablock is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any slot on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param image <a href="/coding/class/structshapebaseimagedata/">ShapeBaseImageData</a> datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the Image is mounted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any slot, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" )
DefineEngineMethod(ShapeBase , mountImage , bool , (ShapeBaseImageData *image, S32 slot, bool loaded, const char *skinTag) , (true, "") , "@brief Mount a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image.\n\n</a>" "@param image the Image <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mount\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mount into (valid range is 0 - 3)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param loaded initial loaded state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@param skinTag tagged string <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> reskin the mounted <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%player.mountImage(PistolImage, 1);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%player.mountImage(CrossbowImage, 0, false);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%player.mountImage(RocketLauncherImage, 0, true, 'blue');\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" " @see unmountImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getMountedImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getPendingImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see isImageMounted()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , pauseThread , bool , (S32 slot) , "@brief Pause an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "If restarted using playThread, the animation " "will resume from the paused <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position.\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stop\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , playAudio , bool , (S32 slot, SFXTrack *track) , "@brief Attach a sound <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this shape and start playing <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it.\n\n</a>" "@param slot Audio slot index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the sound (valid range is 0 - 3)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param track <a href="/coding/class/classsfxtrack/">SFXTrack</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">play\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the sound was attached successfully, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see stopAudio()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , playThread , bool , (S32 slot, const char *name) , ("") , "@brief Start a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> animation thread, or restart one that has been paused or " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stopped.\n\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play. Valid range is 0 - 3)
DefineEngineMethod(ShapeBase , setAllMeshesHidden , void , (bool hide) , "@brief Set the hidden state on all the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">meshes.\n\n</a>" "This allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide all meshes in the shape, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> example, and then only " "enable a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">few.\n</a>" " @param hide <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> hidden state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">meshes\n\n</a>" )
DefineEngineMethod(ShapeBase , setCameraFov , void , (F32 fov) , "@brief Set the vertical field of view in degrees <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this object <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> used as a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">camera.\n\n</a>" "@param fov <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> FOV <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" )
DefineEngineMethod(ShapeBase , setCloaked , void , (bool cloak) , "@brief Set the cloaked state of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "When an object is cloaked it is not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendered.\n</a>" "@param cloak true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> cloak the object, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloak\n</a>" " @see isCloaked()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageFlash , void , (F32 level) , "@brief Set the damage flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "Damage flash may be used as a postfx effect <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> flash the screen when the " "client is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">damaged.\n</a>" "@note Relies on the flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">postFx.\n</a>" "@param level flash level (0-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getDamageFlash()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageLevel , void , (F32 level) , "@brief Set the object's current damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@param level <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see getDamageLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getDamagePercent()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageState , bool , (const char *state) , "@brief Set the object's damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@param state should be one of \"Enabled\" , \"Disabled\" , \"Destroyed\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n</a>" " @see getDamageState()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setDamageVector , void , (Point3F vec) , "@brief Set the damage direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector.\n\n</a>" "Currently this is only used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> initialise the explosion <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> this object " "is blown <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">up.\n</a>" "@param vec damage direction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%obj.setDamageVector( \"0 0 1\" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineEngineMethod(ShapeBase , setEnergyLevel , void , (F32 level) , "@brief Set this object's current energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "@param level <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> energy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" "@see getEnergyLevel()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getEnergyPercent()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setHidden , void , (bool show) , "@brief Add or remove this object from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n\n</a>" "When removed from the scene, the object will not be processed or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendered.\n</a>" " @param show False <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide the object, true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> re-show <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageAltTrigger , bool , (S32 slot, bool state) , "@brief Set the alt trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> alt trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> alt trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageAmmo , bool , (S32 slot, bool state) , "@brief Set the ammo state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> ammo state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> ammo <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageGenericTrigger , S32 , (S32 slot, S32 trigger, bool state) , "@brief Set the generic trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param trigger Generic trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> generic trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> generic trigger state or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there was a <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">problem.\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageLoaded , bool , (S32 slot, bool state) , "@brief Set the loaded state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> loaded state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> loaded <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageScriptAnimPrefix , void , (S32 slot, const char *prefix) , "@brief Set the script animation prefix <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "This is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> further modify the prefix used when deciding which animation sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "play <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> this image is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mounted.\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param prefix The prefix applied <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">image\n</a>" )
DefineEngineMethod(ShapeBase , setImageTarget , bool , (S32 slot, bool state) , "@brief Set the target state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> target state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> target <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setImageTrigger , bool , (S32 slot, bool state) , "@brief Set the trigger state of the Image mounted in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param state <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Image\n</a>" "@return the Image's <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n\n</a>" )
DefineEngineMethod(ShapeBase , setMeshHidden , void , (const char *name, bool hide) , "@brief Set the hidden state on the named shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n\n</a>" "@param name name of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> hide/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">show\n</a>" "@param hide <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> hidden state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh\n\n</a>" )
DefineEngineMethod(ShapeBase , setRechargeRate , void , (F32 rate) , "@brief Set the recharge <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rate.\n\n</a>" "The recharge rate is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the object's current energy level each tick, " "up <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the maxEnergy level set in the <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock.\n</a>" " @param rate the recharge rate(per tick)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getRechargeRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setRepairRate , void , (F32 rate) , "@brief Set amount <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> repair damage by each <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tick.\n\n</a>" "Note that this value is separate <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the repairRate field in ShapeBaseData. " "This value will be subtracted from the damage level each tick, whereas the " "<a href="/coding/class/structshapebasedata/">ShapeBaseData</a> field limits how much of the applyRepair value is subtracted " "each tick. Both repair types can be active at the same <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">time.\n</a>" " @param rate value <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> subtract from damage level each tick(must be > 0)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @see getRepairRate()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setShapeName , void , (const char *name) , "@brief Set the name of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "@note This is the name of the shape object that is sent <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the client, " "not the DTS or DAE model <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n</a>" " @param name <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" " @see getShapeName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setSkinName , void , (const char *name) , "@brief Apply a <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> skin <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n\n</a>" "'Skinning' the shape effectively renames the material targets, allowing " "different materials <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be used on different instances of the same <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">model.\n\n</a>" " @param name name of the skin <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">apply\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">skin\n</a>" " @see getSkinName()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setThreadDir , bool , (S32 slot, bool fwd) , "@brief Set the playback direction of an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param fwd true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play the animation forwards, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> play <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">backwards\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see playThread()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , setThreadPosition , bool , (S32 slot, F32 pos) , "@brief Set the position within an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param pos position within <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , setThreadTimeScale , bool , (S32 slot, F32 scale) , "@brief Set the playback time scale of an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "@param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param scale <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> thread time scale (1=normal speed, 0.5=half speed etc)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , setVelocity , bool , (Point3F vel) , "@brief Set the object's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">velocity.\n\n</a>" "@param vel <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> velocity <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@return <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">true\n\n</a>" )
DefineEngineMethod(ShapeBase , setWhiteOut , void , (F32 level) , "@brief Set the white-out <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "White-out may be used as a postfx effect <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> brighten the screen in response " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> a game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">event.\n</a>" "@note Relies on the flash <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">postFx.\n</a>" "@param level flash level (0-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@see getWhiteOut()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , startFade , void , (S32 time, S32 delay, bool fadeOut) , "@brief Fade the object in or out without removing it from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n\n</a>" "A faded out object is still in the scene and can still be collided with, " "so <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> you want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> disable collisions <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this shape after it fades out " "use setHidden <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> temporarily remove this shape from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">scene.\n</a>" " @note Items have the ability <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> light their surroundings. When an <a href="/coding/class/classitem/">Item</a> with " "an active light is fading out, the light it emits is correspondingly " "reduced until it goes out. Likewise, when the item fades in, the light is " "turned-up till it reaches it 's normal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">brightntess.\n</a>" " @param time duration of the fade effect in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ms\n</a>" " @param delay delay in ms before the fade effect <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">begins\n</a>" " @param fadeOut true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> fade-out <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> invisible, false <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> fade-in <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> full <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">visibility\n</a>" )
DefineEngineMethod(ShapeBase , stopAudio , bool , (S32 slot) , "@brief Stop a sound started with <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playAudio.\n\n</a>" "@param slot audio slot index (started with playAudio)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the sound was stopped successfully, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see playAudio()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBase , stopThread , bool , (S32 slot) , "@brief Stop an animation <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thread.\n\n</a>" "If restarted using playThread, the animation " "will start from the beginning <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">again.\n</a>" " @param slot thread slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">stop\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playThread\n</a>" )
DefineEngineMethod(ShapeBase , unmountImage , bool , (S32 slot) , "@brief Unmount the mounted Image in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">slot.\n\n</a>" "@param slot Image slot <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unmount\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @see mountImage()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
DefineEngineMethod(ShapeBaseData , checkDeployPos , bool , (TransformF txfm) , "@brief Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there is the space at the given transform is free <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> spawn <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">into.\n\n</a>" "The shape's bounding box volume is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> collisions at the given world " "transform. Only interior and static objects are checked <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">collision.\n</a>" "@param txfm Deploy transform <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> the space is free, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> there is already something in " "the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">way.\n</a>" " @note This is a server side only check, and is not actually limited <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawning.\n</a>" )
DefineEngineMethod(ShapeBaseData , getDeployTransform , TransformF , (Point3F pos, Point3F normal) , "@brief Helper method <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get a transform from a position and vector (suitable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> use with setTransform).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@param pos Desired transform <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">position\n</a>" "@param normal <a href="/coding/class/classvector/">Vector</a> of desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">direction\n</a>" "@return The deploy <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform\n</a>" )
IMPLEMENT_CALLBACK(ShapeBase , validateCameraFov , F32 , (F32 fov) , (fov) , "@brief Called on the server when the client has requested a FOV <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">change.\n\n</a>" "When the client requests that its field of view should be changed (because " "they want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use a sniper scope, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> example) this <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> FOV needs <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be validated " "by the server. This method is called <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> it exists (it is optional) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> validate " "the requested FOV, and modify it <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a2594a51175f310ed96ad6cd7d6514878">if</a> necessary. This could be as simple as checking " "that the FOV falls within a correct range, <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> making sure that the FOV matches the " "capabilities of the current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">weapon.\n\n</a>" "Following this method, <a href="/coding/class/classshapebase/">ShapeBase</a> ensures that the given FOV still falls within " "the datablock 's cameraMinFov and cameraMaxFov. If that is good enough <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> your " " purposes, then you do not need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> define the validateCameraFov() callback <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "your <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase.\n\n</a>" " @param fov The FOV that has been requested by the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">client.\n</a>" " @return The FOV as validated by the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">server.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData\n\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onCollision , void , (ShapeBase *obj, SceneObject *collObj, VectorF vec, F32 len) , (obj, collObj, vec, len) , "@brief Called when we collide with another <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param collObj The object we collided <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">with\n</a>" "@param vec <a href="/coding/class/structcollision/">Collision</a> impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1afed088663f8704004425cdae2120b9b3">len</a> Length of the impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onDamage , void , (ShapeBase *obj, F32 delta) , (obj, delta) , "@brief Called when the object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">damaged.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param delta The amount of damage received." )
IMPLEMENT_CALLBACK(ShapeBaseData , onDestroyed , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Destroyed.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onDisabled , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Disabled.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onEnabled , void , (ShapeBase *obj, const char *lastState) , (obj, lastState) , "@brief Called when the object damage state changes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Enabled.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param lastState The previous damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onEndSequence , void , (ShapeBase *obj, S32 slot, const char *name) , (obj, slot, name) , "@brief Called when a thread playing a non-cyclic sequence reaches the end of the " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param slot <a href="/coding/class/classthread/">Thread</a> slot that finished <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing\n</a>" "@param name <a href="/coding/class/classthread/">Thread</a> name that finished <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">playing\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onForceUncloak , void , (ShapeBase *obj, const char *reason) , (obj, reason) , "@brief Called when the object is forced <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloak.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param reason <a href="/coding/class/classstring/">String</a> describing why the object was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">uncloaked\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onImpact , void , (ShapeBase *obj, SceneObject *collObj, VectorF vec, F32 len) , (obj, collObj, vec, len) , "@brief Called when we collide with another object beyond some impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">speed.\n\n</a>" "The <a href="/coding/class/classplayer/">Player</a> class makes use of this callback when a collision speed is more than <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">PlayerData::minImpactSpeed.\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param collObj The object we collided <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">with\n</a>" "@param vec <a href="/coding/class/structcollision/">Collision</a> impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1afed088663f8704004425cdae2120b9b3">len</a> Length of the impact <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vector\n</a>" )
IMPLEMENT_CALLBACK(ShapeBaseData , onTrigger , void , (ShapeBase *obj, S32 index, bool state) , (obj, index, state) , "@brief Called when a move trigger input changes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n\n</a>" "@param obj The <a href="/coding/class/classshapebase/">ShapeBase</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "@param index Index of the trigger that <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">changed\n</a>" "@param state New state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" )
IMPLEMENT_CO_DATABLOCK_V1(ShapeBaseData )
IMPLEMENT_CO_NETOBJECT_V1(ShapeBase )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "platform/platform.h" 25#include "T3D/shapeBase.h" 26 27#include "core/dnet.h" 28#include "sfx/sfxSystem.h" 29#include "sfx/sfxSource.h" 30#include "sfx/sfxTrack.h" 31#include "sfx/sfxDescription.h" 32#include "T3D/sfx/sfx3DWorld.h" 33#include "T3D/gameBase/gameConnection.h" 34#include "console/consoleTypes.h" 35#include "console/engineAPI.h" 36#include "core/stream/bitStream.h" 37#include "ts/tsPartInstance.h" 38#include "ts/tsShapeInstance.h" 39#include "ts/tsMaterialList.h" 40#include "scene/sceneManager.h" 41#include "scene/sceneRenderState.h" 42#include "scene/sceneObjectLightingPlugin.h" 43#include "T3D/fx/explosion.h" 44#include "T3D/fx/cameraFXMgr.h" 45#include "environment/waterBlock.h" 46#include "T3D/debris.h" 47#include "T3D/physicalZone.h" 48#include "T3D/containerQuery.h" 49#include "math/mathUtils.h" 50#include "math/mMatrix.h" 51#include "math/mTransform.h" 52#include "math/mRandom.h" 53#include "platform/profiler.h" 54#include "gfx/gfxCubemap.h" 55#include "gfx/gfxDrawUtil.h" 56#include "gfx/gfxTransformSaver.h" 57#include "renderInstance/renderPassManager.h" 58#include "collision/earlyOutPolyList.h" 59#include "core/resourceManager.h" 60#include "scene/reflectionManager.h" 61#include "gfx/sim/cubemapData.h" 62#include "materials/materialManager.h" 63#include "materials/materialFeatureTypes.h" 64#include "renderInstance/renderOcclusionMgr.h" 65#include "core/stream/fileStream.h" 66#include "T3D/accumulationVolume.h" 67 68IMPLEMENT_CO_DATABLOCK_V1(ShapeBaseData); 69 70ConsoleDocClass( ShapeBaseData, 71 "@brief Defines properties for a ShapeBase object.\n\n" 72 "@see ShapeBase\n" 73 "@ingroup gameObjects\n" 74); 75 76IMPLEMENT_CALLBACK( ShapeBaseData, onEnabled, void, ( ShapeBase* obj, const char* lastState ), ( obj, lastState ), 77 "@brief Called when the object damage state changes to Enabled.\n\n" 78 "@param obj The ShapeBase object\n" 79 "@param lastState The previous damage state\n" ); 80 81IMPLEMENT_CALLBACK( ShapeBaseData, onDisabled, void, ( ShapeBase* obj, const char* lastState ), ( obj, lastState ), 82 "@brief Called when the object damage state changes to Disabled.\n\n" 83 "@param obj The ShapeBase object\n" 84 "@param lastState The previous damage state\n" ); 85 86IMPLEMENT_CALLBACK( ShapeBaseData, onDestroyed, void, ( ShapeBase* obj, const char* lastState ), ( obj, lastState ), 87 "@brief Called when the object damage state changes to Destroyed.\n\n" 88 "@param obj The ShapeBase object\n" 89 "@param lastState The previous damage state\n" ); 90 91IMPLEMENT_CALLBACK( ShapeBaseData, onImpact, void, ( ShapeBase* obj, SceneObject *collObj, VectorF vec, F32 len ), ( obj, collObj, vec, len ), 92 "@brief Called when we collide with another object beyond some impact speed.\n\n" 93 "The Player class makes use of this callback when a collision speed is more than PlayerData::minImpactSpeed.\n" 94 "@param obj The ShapeBase object\n" 95 "@param collObj The object we collided with\n" 96 "@param vec Collision impact vector\n" 97 "@param len Length of the impact vector\n" ); 98 99IMPLEMENT_CALLBACK( ShapeBaseData, onCollision, void, ( ShapeBase* obj, SceneObject *collObj, VectorF vec, F32 len ), ( obj, collObj, vec, len ), 100 "@brief Called when we collide with another object.\n\n" 101 "@param obj The ShapeBase object\n" 102 "@param collObj The object we collided with\n" 103 "@param vec Collision impact vector\n" 104 "@param len Length of the impact vector\n" ); 105 106IMPLEMENT_CALLBACK( ShapeBaseData, onDamage, void, ( ShapeBase* obj, F32 delta ), ( obj, delta ), 107 "@brief Called when the object is damaged.\n\n" 108 "@param obj The ShapeBase object\n" 109 "@param obj The ShapeBase object\n" 110 "@param delta The amount of damage received." ); 111 112IMPLEMENT_CALLBACK( ShapeBaseData, onTrigger, void, ( ShapeBase* obj, S32 index, bool state ), ( obj, index, state ), 113 "@brief Called when a move trigger input changes state.\n\n" 114 "@param obj The ShapeBase object\n" 115 "@param index Index of the trigger that changed\n" 116 "@param state New state of the trigger\n" ); 117 118IMPLEMENT_CALLBACK(ShapeBaseData, onEndSequence, void, (ShapeBase* obj, S32 slot, const char* name), (obj, slot, name), 119 "@brief Called when a thread playing a non-cyclic sequence reaches the end of the " 120 "sequence.\n\n" 121 "@param obj The ShapeBase object\n" 122 "@param slot Thread slot that finished playing\n" 123 "@param name Thread name that finished playing\n"); 124 125IMPLEMENT_CALLBACK( ShapeBaseData, onForceUncloak, void, ( ShapeBase* obj, const char* reason ), ( obj, reason ), 126 "@brief Called when the object is forced to uncloak.\n\n" 127 "@param obj The ShapeBase object\n" 128 "@param reason String describing why the object was uncloaked\n" ); 129 130//---------------------------------------------------------------------------- 131// Timeout for non-looping sounds on a channel 132static SimTime sAudioTimeout = 500; 133F32 ShapeBase::sWhiteoutDec = 0.007f; 134F32 ShapeBase::sDamageFlashDec = 0.02f; 135F32 ShapeBase::sFullCorrectionDistance = 0.5f; 136F32 ShapeBase::sCloakSpeed = 0.5; 137U32 ShapeBase::sLastRenderFrame = 0; 138 139static const char *sDamageStateName[] = 140{ 141 // Index by enum ShapeBase::DamageState 142 "Enabled", 143 "Disabled", 144 "Destroyed" 145}; 146 147 148//---------------------------------------------------------------------------- 149 150ShapeBaseData::ShapeBaseData() 151 : shadowEnable( false ), 152 shadowSize( 128 ), 153 shadowMaxVisibleDistance( 80.0f ), 154 shadowProjectionDistance( 10.0f ), 155 shadowSphereAdjust( 1.0f ), 156 shapeName( StringTable->insert("") ), 157 cloakTexName( StringTable->insert("") ), 158 cubeDescId( 0 ), 159 reflectorDesc( NULL ), 160 debris( NULL ), 161 debrisID( 0 ), 162 debrisShapeName( StringTable->insert("") ), 163 explosion( NULL ), 164 explosionID( 0 ), 165 underwaterExplosion( NULL ), 166 underwaterExplosionID( 0 ), 167 mass( 1.0f ), 168 drag( 0.0f ), 169 density( 1.0f ), 170 maxEnergy( 0.0f ), 171 maxDamage( 1.0f ), 172 repairRate( 0.0033f ), 173 disabledLevel( 1.0f ), 174 destroyedLevel( 1.0f ), 175 cameraMaxDist( 0.0f ), 176 cameraMinDist( 0.2f ), 177 cameraDefaultFov( 75.0f ), 178 cameraMinFov( 5.0f ), 179 cameraMaxFov( 120.f ), 180 cameraCanBank( false ), 181 mountedImagesBank( false ), 182 mCRC( 0 ), 183 computeCRC( false ), 184 eyeNode( -1 ), 185 earNode( -1 ), 186 cameraNode( -1 ), 187 debrisDetail( -1 ), 188 damageSequence( -1 ), 189 hulkSequence( -1 ), 190 observeThroughObject( false ), 191 firstPersonOnly( false ), 192 useEyePoint( false ), 193 isInvincible( false ), 194 renderWhenDestroyed( true ), 195 inheritEnergyFromMount( false ) 196{ 197 dMemset( mountPointNode, -1, sizeof( S32 ) * SceneObject::NumMountPoints ); 198} 199 200struct ShapeBaseDataProto 201{ 202 F32 mass; 203 F32 drag; 204 F32 density; 205 F32 maxEnergy; 206 F32 cameraMaxDist; 207 F32 cameraMinDist; 208 F32 cameraDefaultFov; 209 F32 cameraMinFov; 210 F32 cameraMaxFov; 211 212 213 ShapeBaseDataProto() 214 { 215 mass = 1; 216 drag = 0; 217 density = 1; 218 maxEnergy = 0; 219 cameraMaxDist = 0; 220 cameraMinDist = 0.2f; 221 cameraDefaultFov = 75.f; 222 cameraMinFov = 5.0f; 223 cameraMaxFov = 120.f; 224 } 225}; 226 227static ShapeBaseDataProto gShapeBaseDataProto; 228 229ShapeBaseData::~ShapeBaseData() 230{ 231 232} 233 234bool ShapeBaseData::preload(bool server, String &errorStr) 235{ 236 if (!Parent::preload(server, errorStr)) 237 return false; 238 bool shapeError = false; 239 240 // Resolve objects transmitted from server 241 if (!server) { 242 243 if( !explosion && explosionID != 0 ) 244 { 245 if( Sim::findObject( explosionID, explosion ) == false) 246 { 247 Con::errorf( ConsoleLogEntry::General, "ShapeBaseData::preload: Invalid packet, bad datablockId(explosion): 0x%x", explosionID ); 248 } 249 AssertFatal(!(explosion && ((explosionID < DataBlockObjectIdFirst) || (explosionID > DataBlockObjectIdLast))), 250 "ShapeBaseData::preload: invalid explosion data"); 251 } 252 253 if( !underwaterExplosion && underwaterExplosionID != 0 ) 254 { 255 if( Sim::findObject( underwaterExplosionID, underwaterExplosion ) == false) 256 { 257 Con::errorf( ConsoleLogEntry::General, "ShapeBaseData::preload: Invalid packet, bad datablockId(underwaterExplosion): 0x%x", underwaterExplosionID ); 258 } 259 AssertFatal(!(underwaterExplosion && ((underwaterExplosionID < DataBlockObjectIdFirst) || (underwaterExplosionID > DataBlockObjectIdLast))), 260 "ShapeBaseData::preload: invalid underwaterExplosion data"); 261 } 262 263 if( !debris && debrisID != 0 ) 264 { 265 Sim::findObject( debrisID, debris ); 266 AssertFatal(!(debris && ((debrisID < DataBlockObjectIdFirst) || (debrisID > DataBlockObjectIdLast))), 267 "ShapeBaseData::preload: invalid debris data"); 268 } 269 270 271 if( debrisShapeName && debrisShapeName[0] != '\0' && !bool(debrisShape) ) 272 { 273 debrisShape = ResourceManager::get().load(debrisShapeName); 274 if( bool(debrisShape) == false ) 275 { 276 errorStr = String::ToString("ShapeBaseData::load: Couldn't load shape \"%s\"", debrisShapeName); 277 return false; 278 } 279 else 280 { 281 if(!server && !debrisShape->preloadMaterialList(debrisShape.getPath()) && NetConnection::filesWereDownloaded()) 282 shapeError = true; 283 284 TSShapeInstance* pDummy = new TSShapeInstance(debrisShape, !server); 285 delete pDummy; 286 } 287 } 288 } 289 290 // 291 if (shapeName && shapeName[0]) { 292 S32 i; 293 294 // Resolve shapename 295 mShape = ResourceManager::get().load(shapeName); 296 if (bool(mShape) == false) 297 { 298 errorStr = String::ToString("ShapeBaseData: Couldn't load shape \"%s\"",shapeName); 299 return false; 300 } 301 if(!server && !mShape->preloadMaterialList(mShape.getPath()) && NetConnection::filesWereDownloaded()) 302 shapeError = true; 303 304 if(computeCRC) 305 { 306 Con::printf("Validation required for shape: %s", shapeName); 307 308 Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(mShape.getPath()); 309 310 if (!fileRef) 311 { 312 errorStr = String::ToString("ShapeBaseData: Couldn't load shape \"%s\"",shapeName); 313 return false; 314 } 315 316 if(server) 317 mCRC = fileRef->getChecksum(); 318 else if(mCRC != fileRef->getChecksum()) 319 { 320 errorStr = String::ToString("Shape \"%s\" does not match version on server.",shapeName); 321 return false; 322 } 323 } 324 // Resolve details and camera node indexes. 325 static const String sCollisionStr( "collision-" ); 326 327 for (i = 0; i < mShape->details.size(); i++) 328 { 329 const String &name = mShape->names[mShape->details[i].nameIndex]; 330 331 if (name.compare( sCollisionStr, sCollisionStr.length(), String::NoCase ) == 0) 332 { 333 collisionDetails.push_back(i); 334 collisionBounds.increment(); 335 336 mShape->computeBounds(collisionDetails.last(), collisionBounds.last()); 337 mShape->getAccelerator(collisionDetails.last()); 338 339 if (!mShape->bounds.isContained(collisionBounds.last())) 340 { 341 Con::warnf("Warning: shape %s collision detail %d (Collision-%d) bounds exceed that of shape.", shapeName, collisionDetails.size() - 1, collisionDetails.last()); 342 collisionBounds.last() = mShape->bounds; 343 } 344 else if (collisionBounds.last().isValidBox() == false) 345 { 346 Con::errorf("Error: shape %s-collision detail %d (Collision-%d) bounds box invalid!", shapeName, collisionDetails.size() - 1, collisionDetails.last()); 347 collisionBounds.last() = mShape->bounds; 348 } 349 350 // The way LOS works is that it will check to see if there is a LOS detail that matches 351 // the the collision detail + 1 + MaxCollisionShapes (this variable name should change in 352 // the future). If it can't find a matching LOS it will simply use the collision instead. 353 // We check for any "unmatched" LOS's further down 354 LOSDetails.increment(); 355 356 String buff = String::ToString("LOS-%d", i + 1 + MaxCollisionShapes); 357 U32 los = mShape->findDetail(buff); 358 if (los == -1) 359 LOSDetails.last() = i; 360 else 361 LOSDetails.last() = los; 362 } 363 } 364 365 // Snag any "unmatched" LOS details 366 static const String sLOSStr( "LOS-" ); 367 368 for (i = 0; i < mShape->details.size(); i++) 369 { 370 const String &name = mShape->names[mShape->details[i].nameIndex]; 371 372 if (name.compare( sLOSStr, sLOSStr.length(), String::NoCase ) == 0) 373 { 374 // See if we already have this LOS 375 bool found = false; 376 for (U32 j = 0; j < LOSDetails.size(); j++) 377 { 378 if (LOSDetails[j] == i) 379 { 380 found = true; 381 break; 382 } 383 } 384 385 if (!found) 386 LOSDetails.push_back(i); 387 } 388 } 389 390 debrisDetail = mShape->findDetail("Debris-17"); 391 eyeNode = mShape->findNode("eye"); 392 earNode = mShape->findNode( "ear" ); 393 if( earNode == -1 ) 394 earNode = eyeNode; 395 cameraNode = mShape->findNode("cam"); 396 if (cameraNode == -1) 397 cameraNode = eyeNode; 398 399 // Resolve mount point node indexes 400 for (i = 0; i < SceneObject::NumMountPoints; i++) { 401 char fullName[256]; 402 dSprintf(fullName,sizeof(fullName),"mount%d",i); 403 mountPointNode[i] = mShape->findNode(fullName); 404 } 405 406 // find the AIRepairNode - hardcoded to be the last node in the array... 407 mountPointNode[AIRepairNode] = mShape->findNode("AIRepairNode"); 408 409 // 410 hulkSequence = mShape->findSequence("Visibility"); 411 damageSequence = mShape->findSequence("Damage"); 412 413 // 414 F32 w = mShape->bounds.len_y() / 2; 415 if (cameraMaxDist < w) 416 cameraMaxDist = w; 417 } 418 419 if(!server) 420 { 421/* 422 // grab all the hud images 423 for(U32 i = 0; i < NumHudRenderImages; i++) 424 { 425 if(hudImageNameFriendly[i] && hudImageNameFriendly[i][0]) 426 hudImageFriendly[i] = TextureHandle(hudImageNameFriendly[i], BitmapTexture); 427 428 if(hudImageNameEnemy[i] && hudImageNameEnemy[i][0]) 429 hudImageEnemy[i] = TextureHandle(hudImageNameEnemy[i], BitmapTexture); 430 } 431*/ 432 } 433 434 // Resolve CubeReflectorDesc. 435 if ( cubeDescName.isNotEmpty() ) 436 { 437 Sim::findObject( cubeDescName, reflectorDesc ); 438 } 439 else if( cubeDescId > 0 ) 440 { 441 Sim::findObject( cubeDescId, reflectorDesc ); 442 } 443 444 return !shapeError; 445} 446 447bool ShapeBaseData::_setMass( void* object, const char* index, const char* data ) 448{ 449 ShapeBaseData* shape = reinterpret_cast< ShapeBaseData* >( object ); 450 451 F32 mass = dAtof(data); 452 453 if (mass <= 0) 454 mass = 0.01f; 455 456 shape->mass = mass; 457 458 return false; 459} 460 461 462void ShapeBaseData::initPersistFields() 463{ 464 addGroup( "Shadows" ); 465 466 addField( "shadowEnable", TypeBool, Offset(shadowEnable, ShapeBaseData), 467 "Enable shadows for this shape (currently unused, shadows are always enabled)." ); 468 addField( "shadowSize", TypeS32, Offset(shadowSize, ShapeBaseData), 469 "Size of the projected shadow texture (must be power of 2)." ); 470 addField( "shadowMaxVisibleDistance", TypeF32, Offset(shadowMaxVisibleDistance, ShapeBaseData), 471 "Maximum distance at which shadow is visible (currently unused)." ); 472 addField( "shadowProjectionDistance", TypeF32, Offset(shadowProjectionDistance, ShapeBaseData), 473 "Maximum height above ground to project shadow. If the object is higher " 474 "than this no shadow will be rendered." ); 475 addField( "shadowSphereAdjust", TypeF32, Offset(shadowSphereAdjust, ShapeBaseData), 476 "Scalar applied to the radius of spot shadows (initial radius is based " 477 "on the shape bounds but can be adjusted with this field)." ); 478 479 endGroup( "Shadows" ); 480 481 addGroup( "Render" ); 482 483 addField( "shapeFile", TypeShapeFilename, Offset(shapeName, ShapeBaseData), 484 "The DTS or DAE model to use for this object." ); 485 486 endGroup( "Render" ); 487 488 addGroup( "Destruction", "Parameters related to the destruction effects of this object." ); 489 490 addField( "explosion", TYPEID< ExplosionData >(), Offset(explosion, ShapeBaseData), 491 "%Explosion to generate when this shape is blown up." ); 492 addField( "underwaterExplosion", TYPEID< ExplosionData >(), Offset(underwaterExplosion, ShapeBaseData), 493 "%Explosion to generate when this shape is blown up underwater." ); 494 addField( "debris", TYPEID< DebrisData >(), Offset(debris, ShapeBaseData), 495 "%Debris to generate when this shape is blown up." ); 496 addField( "renderWhenDestroyed", TypeBool, Offset(renderWhenDestroyed, ShapeBaseData), 497 "Whether to render the shape when it is in the \"Destroyed\" damage state." ); 498 addField( "debrisShapeName", TypeShapeFilename, Offset(debrisShapeName, ShapeBaseData), 499 "The DTS or DAE model to use for auto-generated breakups. @note may not be functional." ); 500 501 endGroup( "Destruction" ); 502 503 addGroup( "Physics" ); 504 505 addProtectedField("mass", TypeF32, Offset(mass, ShapeBaseData), &_setMass, &defaultProtectedGetFn, "Shape mass.\nUsed in simulation of moving objects.\n" ); 506 addField( "drag", TypeF32, Offset(drag, ShapeBaseData), 507 "Drag factor.\nReduces velocity of moving objects." ); 508 addField( "density", TypeF32, Offset(density, ShapeBaseData), 509 "Shape density.\nUsed when computing buoyancy when in water.\n" ); 510 511 endGroup( "Physics" ); 512 513 addGroup( "Damage/Energy" ); 514 515 addField( "maxEnergy", TypeF32, Offset(maxEnergy, ShapeBaseData), 516 "Maximum energy level for this object." ); 517 addField( "maxDamage", TypeF32, Offset(maxDamage, ShapeBaseData), 518 "Maximum damage level for this object." ); 519 addField( "disabledLevel", TypeF32, Offset(disabledLevel, ShapeBaseData), 520 "Damage level above which the object is disabled.\n" 521 "Currently unused." ); 522 addField( "destroyedLevel", TypeF32, Offset(destroyedLevel, ShapeBaseData), 523 "Damage level above which the object is destroyed.\n" 524 "When the damage level increases above this value, the object damage " 525 "state is set to \"Destroyed\"." ); 526 addField( "repairRate", TypeF32, Offset(repairRate, ShapeBaseData), 527 "Rate at which damage is repaired in damage units/tick.\n" 528 "This value is subtracted from the damage level until it reaches 0." ); 529 addField( "inheritEnergyFromMount", TypeBool, Offset(inheritEnergyFromMount, ShapeBaseData), 530 "Flag controlling whether to manage our own energy level, or to use " 531 "the energy level of the object we are mounted to." ); 532 addField( "isInvincible", TypeBool, Offset(isInvincible, ShapeBaseData), 533 "Invincible flag; when invincible, the object cannot be damaged or " 534 "repaired." ); 535 536 endGroup( "Damage/Energy" ); 537 538 addGroup( "Camera", "The settings used by the shape when it is the camera." ); 539 540 addField( "cameraMaxDist", TypeF32, Offset(cameraMaxDist, ShapeBaseData), 541 "The maximum distance from the camera to the object.\n" 542 "Used when computing a custom camera transform for this object.\n\n" 543 "@see observeThroughObject" ); 544 addField( "cameraMinDist", TypeF32, Offset(cameraMinDist, ShapeBaseData), 545 "The minimum distance from the camera to the object.\n" 546 "Used when computing a custom camera transform for this object.\n\n" 547 "@see observeThroughObject" ); 548 addField( "cameraDefaultFov", TypeF32, Offset(cameraDefaultFov, ShapeBaseData), 549 "The default camera vertical FOV in degrees." ); 550 addField( "cameraMinFov", TypeF32, Offset(cameraMinFov, ShapeBaseData), 551 "The minimum camera vertical FOV allowed in degrees." ); 552 addField( "cameraMaxFov", TypeF32, Offset(cameraMaxFov, ShapeBaseData), 553 "The maximum camera vertical FOV allowed in degrees." ); 554 addField( "cameraCanBank", TypeBool, Offset(cameraCanBank, ShapeBaseData), 555 "If the derrived class supports it, allow the camera to bank." ); 556 addField( "mountedImagesBank", TypeBool, Offset(mountedImagesBank, ShapeBaseData), 557 "Do mounted images bank along with the camera?" ); 558 addField( "firstPersonOnly", TypeBool, Offset(firstPersonOnly, ShapeBaseData), 559 "Flag controlling whether the view from this object is first person " 560 "only." ); 561 addField( "useEyePoint", TypeBool, Offset(useEyePoint, ShapeBaseData), 562 "Flag controlling whether the client uses this object's eye point to " 563 "view from." ); 564 addField( "observeThroughObject", TypeBool, Offset(observeThroughObject, ShapeBaseData), 565 "Observe this object through its camera transform and default fov.\n" 566 "If true, when this object is the camera it can provide a custom camera " 567 "transform and FOV (instead of the default eye transform)." ); 568 569 endGroup("Camera"); 570 571 addGroup( "Misc" ); 572 573 addField( "computeCRC", TypeBool, Offset(computeCRC, ShapeBaseData), 574 "If true, verify that the CRC of the client's shape model matches the " 575 "server's CRC for the shape model when loaded by the client." ); 576 577 endGroup( "Misc" ); 578 579 addGroup( "Reflection" ); 580 581 addField( "cubeReflectorDesc", TypeRealString, Offset( cubeDescName, ShapeBaseData ), 582 "References a ReflectorDesc datablock that defines performance and quality properties for dynamic reflections.\n"); 583 //addField( "reflectMaxRateMs", TypeS32, Offset( reflectMaxRateMs, ShapeBaseData ), "reflection will not be updated more frequently than this" ); 584 //addField( "reflectMaxDist", TypeF32, Offset( reflectMaxDist, ShapeBaseData ), "distance at which reflection is never updated" ); 585 //addField( "reflectMinDist", TypeF32, Offset( reflectMinDist, ShapeBaseData ), "distance at which reflection is always updated" ); 586 //addField( "reflectDetailAdjust", TypeF32, Offset( reflectDetailAdjust, ShapeBaseData ), "scale up or down the detail level for objects rendered in a reflection" ); 587 588 endGroup( "Reflection" ); 589 590 Parent::initPersistFields(); 591} 592 593DefineEngineMethod( ShapeBaseData, checkDeployPos, bool, ( TransformF txfm ),, 594 "@brief Check if there is the space at the given transform is free to spawn into.\n\n" 595 596 "The shape's bounding box volume is used to check for collisions at the given world " 597 "transform. Only interior and static objects are checked for collision.\n" 598 599 "@param txfm Deploy transform to check\n" 600 "@return True if the space is free, false if there is already something in " 601 "the way.\n" 602 603 "@note This is a server side only check, and is not actually limited to spawning.\n") 604{ 605 if (bool(object->mShape) == false) 606 return false; 607 608 MatrixF mat = txfm.getMatrix(); 609 610 Box3F objBox = object->mShape->bounds; 611 Point3F boxCenter = (objBox.minExtents + objBox.maxExtents) * 0.5f; 612 objBox.minExtents = boxCenter + (objBox.minExtents - boxCenter) * 0.9f; 613 objBox.maxExtents = boxCenter + (objBox.maxExtents - boxCenter) * 0.9f; 614 615 Box3F wBox = objBox; 616 mat.mul(wBox); 617 618 EarlyOutPolyList polyList; 619 polyList.mNormal.set(0,0,0); 620 polyList.mPlaneList.clear(); 621 polyList.mPlaneList.setSize(6); 622 polyList.mPlaneList[0].set(objBox.minExtents,VectorF(-1,0,0)); 623 polyList.mPlaneList[1].set(objBox.maxExtents,VectorF(0,1,0)); 624 polyList.mPlaneList[2].set(objBox.maxExtents,VectorF(1,0,0)); 625 polyList.mPlaneList[3].set(objBox.minExtents,VectorF(0,-1,0)); 626 polyList.mPlaneList[4].set(objBox.minExtents,VectorF(0,0,-1)); 627 polyList.mPlaneList[5].set(objBox.maxExtents,VectorF(0,0,1)); 628 629 for (U32 i = 0; i < 6; i++) 630 { 631 PlaneF temp; 632 mTransformPlane(mat, Point3F(1, 1, 1), polyList.mPlaneList[i], &temp); 633 polyList.mPlaneList[i] = temp; 634 } 635 636 if (gServerContainer.buildPolyList(PLC_Collision, wBox, StaticShapeObjectType, &polyList)) 637 return false; 638 return true; 639} 640 641 642DefineEngineMethod(ShapeBaseData, getDeployTransform, TransformF, ( Point3F pos, Point3F normal ),, 643 "@brief Helper method to get a transform from a position and vector (suitable for use with setTransform).\n\n" 644 "@param pos Desired transform position\n" 645 "@param normal Vector of desired direction\n" 646 "@return The deploy transform\n" ) 647{ 648 normal.normalize(); 649 650 VectorF xAxis; 651 if( mFabs(normal.z) > mFabs(normal.x) && mFabs(normal.z) > mFabs(normal.y)) 652 mCross( VectorF( 0, 1, 0 ), normal, &xAxis ); 653 else 654 mCross( VectorF( 0, 0, 1 ), normal, &xAxis ); 655 656 VectorF yAxis; 657 mCross( normal, xAxis, &yAxis ); 658 659 MatrixF testMat(true); 660 testMat.setColumn( 0, xAxis ); 661 testMat.setColumn( 1, yAxis ); 662 testMat.setColumn( 2, normal ); 663 testMat.setPosition( pos ); 664 665 return testMat; 666} 667 668void ShapeBaseData::packData(BitStream* stream) 669{ 670 Parent::packData(stream); 671 672 if(stream->writeFlag(computeCRC)) 673 stream->write(mCRC); 674 675 stream->writeFlag(shadowEnable); 676 stream->write(shadowSize); 677 stream->write(shadowMaxVisibleDistance); 678 stream->write(shadowProjectionDistance); 679 stream->write(shadowSphereAdjust); 680 681 682 stream->writeString(shapeName); 683 stream->writeString(cloakTexName); 684 if(stream->writeFlag(mass != gShapeBaseDataProto.mass)) 685 stream->write(mass); 686 if(stream->writeFlag(drag != gShapeBaseDataProto.drag)) 687 stream->write(drag); 688 if(stream->writeFlag(density != gShapeBaseDataProto.density)) 689 stream->write(density); 690 if(stream->writeFlag(maxEnergy != gShapeBaseDataProto.maxEnergy)) 691 stream->write(maxEnergy); 692 if(stream->writeFlag(cameraMaxDist != gShapeBaseDataProto.cameraMaxDist)) 693 stream->write(cameraMaxDist); 694 if(stream->writeFlag(cameraMinDist != gShapeBaseDataProto.cameraMinDist)) 695 stream->write(cameraMinDist); 696 cameraDefaultFov = mClampF(cameraDefaultFov, cameraMinFov, cameraMaxFov); 697 if(stream->writeFlag(cameraDefaultFov != gShapeBaseDataProto.cameraDefaultFov)) 698 stream->write(cameraDefaultFov); 699 if(stream->writeFlag(cameraMinFov != gShapeBaseDataProto.cameraMinFov)) 700 stream->write(cameraMinFov); 701 if(stream->writeFlag(cameraMaxFov != gShapeBaseDataProto.cameraMaxFov)) 702 stream->write(cameraMaxFov); 703 stream->writeFlag(cameraCanBank); 704 stream->writeFlag(mountedImagesBank); 705 stream->writeString( debrisShapeName ); 706 707 stream->writeFlag(observeThroughObject); 708 709 if( stream->writeFlag( debris != NULL ) ) 710 { 711 stream->writeRangedU32(packed? SimObjectId((uintptr_t)debris): 712 debris->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); 713 } 714 715 stream->writeFlag(isInvincible); 716 stream->writeFlag(renderWhenDestroyed); 717 718 if( stream->writeFlag( explosion != NULL ) ) 719 { 720 stream->writeRangedU32( explosion->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); 721 } 722 723 if( stream->writeFlag( underwaterExplosion != NULL ) ) 724 { 725 stream->writeRangedU32( underwaterExplosion->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); 726 } 727 728 stream->writeFlag(inheritEnergyFromMount); 729 stream->writeFlag(firstPersonOnly); 730 stream->writeFlag(useEyePoint); 731 732 if( stream->writeFlag( reflectorDesc != NULL ) ) 733 { 734 stream->writeRangedU32( reflectorDesc->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); 735 } 736 737 //stream->write(reflectPriority); 738 //stream->write(reflectMaxRateMs); 739 //stream->write(reflectMinDist); 740 //stream->write(reflectMaxDist); 741 //stream->write(reflectDetailAdjust); 742} 743 744void ShapeBaseData::unpackData(BitStream* stream) 745{ 746 Parent::unpackData(stream); 747 computeCRC = stream->readFlag(); 748 if(computeCRC) 749 stream->read(&mCRC); 750 751 shadowEnable = stream->readFlag(); 752 stream->read(&shadowSize); 753 stream->read(&shadowMaxVisibleDistance); 754 stream->read(&shadowProjectionDistance); 755 stream->read(&shadowSphereAdjust); 756 757 shapeName = stream->readSTString(); 758 cloakTexName = stream->readSTString(); 759 if(stream->readFlag()) 760 stream->read(&mass); 761 else 762 mass = gShapeBaseDataProto.mass; 763 764 if(stream->readFlag()) 765 stream->read(&drag); 766 else 767 drag = gShapeBaseDataProto.drag; 768 769 if(stream->readFlag()) 770 stream->read(&density); 771 else 772 density = gShapeBaseDataProto.density; 773 774 if(stream->readFlag()) 775 stream->read(&maxEnergy); 776 else 777 maxEnergy = gShapeBaseDataProto.maxEnergy; 778 779 if(stream->readFlag()) 780 stream->read(&cameraMaxDist); 781 else 782 cameraMaxDist = gShapeBaseDataProto.cameraMaxDist; 783 784 if(stream->readFlag()) 785 stream->read(&cameraMinDist); 786 else 787 cameraMinDist = gShapeBaseDataProto.cameraMinDist; 788 789 if(stream->readFlag()) 790 stream->read(&cameraDefaultFov); 791 else 792 cameraDefaultFov = gShapeBaseDataProto.cameraDefaultFov; 793 794 if(stream->readFlag()) 795 stream->read(&cameraMinFov); 796 else 797 cameraMinFov = gShapeBaseDataProto.cameraMinFov; 798 799 if(stream->readFlag()) 800 stream->read(&cameraMaxFov); 801 else 802 cameraMaxFov = gShapeBaseDataProto.cameraMaxFov; 803 804 cameraCanBank = stream->readFlag(); 805 mountedImagesBank = stream->readFlag(); 806 807 debrisShapeName = stream->readSTString(); 808 809 observeThroughObject = stream->readFlag(); 810 811 if( stream->readFlag() ) 812 { 813 debrisID = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); 814 } 815 816 isInvincible = stream->readFlag(); 817 renderWhenDestroyed = stream->readFlag(); 818 819 if( stream->readFlag() ) 820 { 821 explosionID = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); 822 } 823 824 if( stream->readFlag() ) 825 { 826 underwaterExplosionID = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); 827 } 828 829 inheritEnergyFromMount = stream->readFlag(); 830 firstPersonOnly = stream->readFlag(); 831 useEyePoint = stream->readFlag(); 832 833 if( stream->readFlag() ) 834 { 835 cubeDescId = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); 836 } 837 838 //stream->read(&reflectPriority); 839 //stream->read(&reflectMaxRateMs); 840 //stream->read(&reflectMinDist); 841 //stream->read(&reflectMaxDist); 842 //stream->read(&reflectDetailAdjust); 843} 844 845 846//---------------------------------------------------------------------------- 847//---------------------------------------------------------------------------- 848 849Chunker<ShapeBase::CollisionTimeout> sTimeoutChunker; 850ShapeBase::CollisionTimeout* ShapeBase::sFreeTimeoutList = 0; 851 852 853//---------------------------------------------------------------------------- 854 855IMPLEMENT_CO_NETOBJECT_V1(ShapeBase); 856 857ConsoleDocClass( ShapeBase, 858 "@ingroup gameObjects" 859); 860 861IMPLEMENT_CALLBACK( ShapeBase, validateCameraFov, F32, (F32 fov), (fov), 862 "@brief Called on the server when the client has requested a FOV change.\n\n" 863 864 "When the client requests that its field of view should be changed (because " 865 "they want to use a sniper scope, for example) this new FOV needs to be validated " 866 "by the server. This method is called if it exists (it is optional) to validate " 867 "the requested FOV, and modify it if necessary. This could be as simple as checking " 868 "that the FOV falls within a correct range, to making sure that the FOV matches the " 869 "capabilities of the current weapon.\n\n" 870 871 "Following this method, ShapeBase ensures that the given FOV still falls within " 872 "the datablock's cameraMinFov and cameraMaxFov. If that is good enough for your " 873 "purposes, then you do not need to define the validateCameraFov() callback for " 874 "your ShapeBase.\n\n" 875 876 "@param fov The FOV that has been requested by the client.\n" 877 "@return The FOV as validated by the server.\n\n" 878 879 "@see ShapeBaseData\n\n"); 880 881ShapeBase::ShapeBase() 882 : mDataBlock( NULL ), 883 mIsAiControlled( false ), 884 mAiPose( 0 ), 885 mControllingObject( NULL ), 886 mMoveMotion( false ), 887 mShapeBaseMount( NULL ), 888 mShapeInstance( NULL ), 889 mConvexList( new Convex ), 890 mEnergy( 0.0f ), 891 mRechargeRate( 0.0f ), 892 mMass( 1.0f ), 893 mOneOverMass( 1.0f ), 894 mDrag( 0.0f ), 895 mBuoyancy( 0.0f ), 896 mLiquidHeight( 0.0f ), 897 mWaterCoverage( 0.0f ), 898 mAppliedForce( Point3F::Zero ), 899 mGravityMod( 1.0f ), 900 mDamageFlash( 0.0f ), 901 mWhiteOut( 0.0f ), 902 mFlipFadeVal( false ), 903 mTimeoutList( NULL ), 904 mDamage( 0.0f ), 905 mRepairRate( 0.0f ), 906 mRepairReserve( 0.0f ), 907 mDamageState( Enabled ), 908 mDamageThread( NULL ), 909 mHulkThread( NULL ), 910 damageDir( 0.0f, 0.0f, 1.0f ), 911 mCloaked( false ), 912 mCloakLevel( 0.0f ), 913 mFadeOut( true ), 914 mFading( false ), 915 mFadeVal( 1.0f ), 916 mFadeElapsedTime( 0.0f ), 917 mFadeTime( 1.0f ), 918 mFadeDelay( 0.0f ), 919 mCameraFov( 90.0f ), 920 mIsControlled( false ), 921 mLastRenderFrame( 0 ), 922 mLastRenderDistance( 0.0f ) 923{ 924 mTypeMask |= ShapeBaseObjectType | LightObjectType; 925 926 S32 i; 927 928 for (i = 0; i < MaxSoundThreads; i++) { 929 mSoundThread[i].play = false; 930 mSoundThread[i].profile = 0; 931 mSoundThread[i].sound = 0; 932 } 933 934 for (i = 0; i < MaxScriptThreads; i++) { 935 mScriptThread[i].sequence = -1; 936 mScriptThread[i].thread = 0; 937 mScriptThread[i].state = Thread::Stop; 938 mScriptThread[i].atEnd = false; 939 mScriptThread[i].timescale = 1.f; 940 mScriptThread[i].position = -1.f; 941 } 942 943 for (i = 0; i < MaxTriggerKeys; i++) 944 mTrigger[i] = false; 945} 946 947 948ShapeBase::~ShapeBase() 949{ 950 SAFE_DELETE( mConvexList ); 951 952 AssertFatal(mMount.link == 0,"ShapeBase::~ShapeBase: An object is still mounted"); 953 if( mShapeInstance && (mShapeInstance->getDebrisRefCount() == 0) ) 954 { 955 delete mShapeInstance; 956 mShapeInstance = NULL; 957 } 958 959 CollisionTimeout* ptr = mTimeoutList; 960 while (ptr) { 961 CollisionTimeout* cur = ptr; 962 ptr = ptr->next; 963 cur->next = sFreeTimeoutList; 964 sFreeTimeoutList = cur; 965 } 966} 967 968void ShapeBase::initPersistFields() 969{ 970 addProtectedField( "skin", TypeRealString, Offset(mAppliedSkinName, ShapeBase), &_setFieldSkin, &_getFieldSkin, 971 "@brief The skin applied to the shape.\n\n" 972 973 "'Skinning' the shape effectively renames the material targets, allowing " 974 "different materials to be used on different instances of the same model. " 975 "Using getSkinName() and setSkinName() is equivalent to reading and " 976 "writing the skin field directly.\n\n" 977 978 "Any material targets that start with the old skin name have that part " 979 "of the name replaced with the new skin name. The initial old skin name is " 980 "\"base\". For example, if a new skin of \"blue\" was applied to a model " 981 "that had material targets <i>base_body</i> and <i>face</i>, the new targets " 982 "would be <i>blue_body</i> and <i>face</i>. Note that <i>face</i> was not " 983 "renamed since it did not start with the old skin name of \"base\".\n\n" 984 985 "To support models that do not use the default \"base\" naming convention, " 986 "you can also specify the part of the name to replace in the skin field " 987 "itself. For example, if a model had a material target called <i>shapemat</i>, " 988 "we could apply a new skin \"shape=blue\", and the material target would be " 989 "renamed to <i>bluemat</i> (note \"shape\" has been replaced with \"blue\").\n\n" 990 991 "Multiple skin updates can also be applied at the same time by separating " 992 "them with a semicolon. For example: \"base=blue;face=happy_face\".\n\n" 993 994 "Material targets are only renamed if an existing Material maps to that " 995 "name, or if there is a diffuse texture in the model folder with the same " 996 "name as the new target.\n\n" ); 997 998 addField( "isAiControlled", TypeBool, Offset(mIsAiControlled, ShapeBase), 999 "@brief Is this object AI controlled.\n\n" 1000 "If True then this object is considered AI controlled and not player controlled.\n" ); 1001 1002 Parent::initPersistFields(); 1003} 1004 1005bool ShapeBase::_setFieldSkin( void *object, const char *index, const char *data ) 1006{ 1007 ShapeBase* shape = static_cast<ShapeBase*>( object ); 1008 if ( shape ) 1009 shape->setSkinName( data ); 1010 return false; 1011} 1012 1013const char *ShapeBase::_getFieldSkin( void *object, const char *data ) 1014{ 1015 ShapeBase* shape = static_cast<ShapeBase*>( object ); 1016 return shape ? shape->getSkinName() : ""; 1017} 1018 1019//---------------------------------------------------------------------------- 1020 1021bool ShapeBase::onAdd() 1022{ 1023 if( !Parent::onAdd() ) 1024 return false; 1025 1026 if( !mDataBlock ) 1027 { 1028 Con::errorf( "ShapeBase::onAdd - no datablock on shape %i:%s (%s)", 1029 getId(), getClassName(), getName() ); 1030 return false; 1031 } 1032 1033 // Resolve sounds that arrived in the initial update 1034 S32 i; 1035 for (i = 0; i < MaxSoundThreads; i++) 1036 updateAudioState(mSoundThread[i]); 1037 1038 for (i = 0; i < MaxScriptThreads; i++) 1039 { 1040 Thread& st = mScriptThread[i]; 1041 if(st.thread) 1042 updateThread(st); 1043 } 1044 1045/* 1046 if(mDataBlock->cloakTexName != StringTable->insert("")) 1047 mCloakTexture = TextureHandle(mDataBlock->cloakTexName, MeshTexture, false); 1048*/ 1049 // Accumulation and environment mapping 1050 if (isClientObject() && mShapeInstance) 1051 { 1052 AccumulationVolume::addObject(this); 1053 } 1054 return true; 1055} 1056 1057void ShapeBase::onRemove() 1058{ 1059 mConvexList->nukeList(); 1060 1061 Parent::onRemove(); 1062 1063 // Stop any running sounds on the client 1064 if (isGhost()) 1065 for (S32 i = 0; i < MaxSoundThreads; i++) 1066 stopAudio(i); 1067 1068 if ( isClientObject() ) 1069 { 1070 mCubeReflector.unregisterReflector(); 1071 } 1072} 1073 1074 1075void ShapeBase::onSceneRemove() 1076{ 1077 mConvexList->nukeList(); 1078 Parent::onSceneRemove(); 1079} 1080 1081bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload ) 1082{ 1083 ShapeBaseData *prevDB = dynamic_cast<ShapeBaseData*>( mDataBlock ); 1084 1085 bool isInitialDataBlock = ( mDataBlock == 0 ); 1086 1087 if ( Parent::onNewDataBlock( dptr, reload ) == false ) 1088 return false; 1089 1090 mDataBlock = dynamic_cast<ShapeBaseData*>(dptr); 1091 if (!mDataBlock) 1092 return false; 1093 1094 setMaskBits(DamageMask); 1095 mDamageThread = 0; 1096 mHulkThread = 0; 1097 1098 // Even if loadShape succeeds, there may not actually be 1099 // a shape assigned to this object. 1100 if (bool(mDataBlock->mShape)) { 1101 delete mShapeInstance; 1102 mShapeInstance = new TSShapeInstance(mDataBlock->mShape, isClientObject()); 1103 if (isClientObject()) 1104 mShapeInstance->cloneMaterialList(); 1105 1106 mObjBox = mDataBlock->mShape->bounds; 1107 resetWorldBox(); 1108 1109 // Set the initial mesh hidden state. 1110 mMeshHidden.setSize( mDataBlock->mShape->objects.size() ); 1111 mMeshHidden.clear(); 1112 1113 // Initialize the threads 1114 for (U32 i = 0; i < MaxScriptThreads; i++) { 1115 Thread& st = mScriptThread[i]; 1116 if (st.sequence != -1) { 1117 // TG: Need to see about suppressing non-cyclic sounds 1118 // if the sequences were activated before the object was 1119 // ghosted. 1120 // TG: Cyclic animations need to have a random pos if 1121 // they were started before the object was ghosted. 1122 1123 // If there was something running on the old shape, the thread 1124 // needs to be reset. Otherwise we assume that it's been 1125 // initialized either by the constructor or from the server. 1126 bool reset = st.thread != 0; 1127 st.thread = 0; 1128 1129 // New datablock/shape may not actually HAVE this sequence. 1130 // In that case stop playing it. 1131 1132 AssertFatal( prevDB != NULL, "ShapeBase::onNewDataBlock - how did you have a sequence playing without a prior datablock?" ); 1133 1134 const TSShape *prevShape = prevDB->mShape; 1135 const TSShape::Sequence &prevSeq = prevShape->sequences[st.sequence]; 1136 const String &prevSeqName = prevShape->names[prevSeq.nameIndex]; 1137 1138 st.sequence = mDataBlock->mShape->findSequence( prevSeqName ); 1139 1140 if ( st.sequence != -1 ) 1141 { 1142 setThreadSequence( i, st.sequence, reset ); 1143 } 1144 } 1145 } 1146 1147 if (mDataBlock->damageSequence != -1) { 1148 mDamageThread = mShapeInstance->addThread(); 1149 mShapeInstance->setSequence(mDamageThread, 1150 mDataBlock->damageSequence,0); 1151 } 1152 if (mDataBlock->hulkSequence != -1) { 1153 mHulkThread = mShapeInstance->addThread(); 1154 mShapeInstance->setSequence(mHulkThread, 1155 mDataBlock->hulkSequence,0); 1156 } 1157 1158 if( isGhost() ) 1159 { 1160 // Reapply the current skin 1161 mAppliedSkinName = ""; 1162 reSkin(); 1163 } 1164 } 1165 1166 // 1167 mEnergy = 0; 1168 mDamage = 0; 1169 mDamageState = Enabled; 1170 mRepairReserve = 0; 1171 updateMass(); 1172 updateDamageLevel(); 1173 updateDamageState(); 1174 1175 mDrag = mDataBlock->drag; 1176 mCameraFov = mDataBlock->cameraDefaultFov; 1177 updateMass(); 1178 1179 if( !isInitialDataBlock && mLightPlugin ) 1180 mLightPlugin->reset(); 1181 1182 if ( isClientObject() ) 1183 { 1184 mCubeReflector.unregisterReflector(); 1185 1186 if ( mDataBlock->reflectorDesc ) 1187 mCubeReflector.registerReflector( this, mDataBlock->reflectorDesc ); 1188 } 1189 1190 return true; 1191} 1192 1193void ShapeBase::onDeleteNotify( SimObject *obj ) 1194{ 1195 if ( obj == mCurrentWaterObject ) 1196 mCurrentWaterObject = NULL; 1197 1198 Parent::onDeleteNotify( obj ); 1199} 1200 1201void ShapeBase::onImpact(SceneObject* obj, const VectorF& vec) 1202{ 1203 if (!isGhost()) 1204 mDataBlock->onImpact_callback( this, obj, vec, vec.len() ); 1205} 1206 1207void ShapeBase::onImpact(const VectorF& vec) 1208{ 1209 if (!isGhost()) 1210 mDataBlock->onImpact_callback( this, NULL, vec, vec.len() ); 1211} 1212 1213 1214//---------------------------------------------------------------------------- 1215 1216void ShapeBase::processTick(const Move* move) 1217{ 1218 PROFILE_SCOPE( ShapeBase_ProcessTick ); 1219 1220 // Energy management 1221 if (mDamageState == Enabled && mDataBlock->inheritEnergyFromMount == false) { 1222 F32 store = mEnergy; 1223 mEnergy += mRechargeRate; 1224 if (mEnergy > mDataBlock->maxEnergy) 1225 mEnergy = mDataBlock->maxEnergy; 1226 else 1227 if (mEnergy < 0) 1228 mEnergy = 0; 1229 1230 // Virtual setEnergyLevel is used here by some derived classes to 1231 // decide whether they really want to set the energy mask bit. 1232 if (mEnergy != store) 1233 setEnergyLevel(mEnergy); 1234 } 1235 1236 // Repair management 1237 if (mDataBlock->isInvincible == false) 1238 { 1239 F32 store = mDamage; 1240 mDamage -= mRepairRate; 1241 mDamage = mClampF(mDamage, 0.f, mDataBlock->maxDamage); 1242 1243 if (mRepairReserve > mDamage) 1244 mRepairReserve = mDamage; 1245 if (mRepairReserve > 0.0) 1246 { 1247 F32 rate = getMin(mDataBlock->repairRate, mRepairReserve); 1248 mDamage -= rate; 1249 mRepairReserve -= rate; 1250 } 1251 1252 if (store != mDamage) 1253 { 1254 updateDamageLevel(); 1255 if (isServerObject()) { 1256 setMaskBits(DamageMask); 1257 mDataBlock->onDamage_callback( this, mDamage - store ); 1258 } 1259 } 1260 } 1261 1262 if (isServerObject()) { 1263 // Server only... 1264 advanceThreads(TickSec); 1265 updateServerAudio(); 1266 1267 // update wet state 1268 setImageWetState(0, mWaterCoverage > 0.4); // more than 40 percent covered 1269 1270 // update motion state 1271 mMoveMotion = false; 1272 if (move && (move->x || move->y || move->z)) 1273 { 1274 mMoveMotion = true; 1275 } 1276 for (S32 i = 0; i < MaxMountedImages; i++) 1277 { 1278 setImageMotionState(i, mMoveMotion); 1279 } 1280 1281 if(mFading) 1282 { 1283 F32 dt = TickMs / 1000.0f; 1284 F32 newFadeET = mFadeElapsedTime + dt; 1285 if(mFadeElapsedTime < mFadeDelay && newFadeET >= mFadeDelay) 1286 setMaskBits(CloakMask); 1287 mFadeElapsedTime = newFadeET; 1288 if(mFadeElapsedTime > mFadeTime + mFadeDelay) 1289 { 1290 mFadeVal = F32(!mFadeOut); 1291 mFading = false; 1292 } 1293 } 1294 } 1295 1296 // Advance images 1297 if (isServerObject()) 1298 { 1299 for (S32 i = 0; i < MaxMountedImages; i++) 1300 { 1301 if (mMountedImageList[i].dataBlock) 1302 updateImageState(i, TickSec); 1303 } 1304 } 1305 1306 // Call script on trigger state changes 1307 if (move && mDataBlock && isServerObject()) 1308 { 1309 for (S32 i = 0; i < MaxTriggerKeys; i++) 1310 { 1311 if (move->trigger[i] != mTrigger[i]) 1312 { 1313 mTrigger[i] = move->trigger[i]; 1314 mDataBlock->onTrigger_callback( this, i, move->trigger[i] ); 1315 } 1316 } 1317 } 1318 1319 // Update the damage flash and the whiteout 1320 // 1321 if (mDamageFlash > 0.0) 1322 { 1323 mDamageFlash -= sDamageFlashDec; 1324 if (mDamageFlash <= 0.0) 1325 mDamageFlash = 0.0; 1326 } 1327 if (mWhiteOut > 0.0) 1328 { 1329 mWhiteOut -= sWhiteoutDec; 1330 if (mWhiteOut <= 0.0) 1331 mWhiteOut = 0.0; 1332 } 1333 1334 if (isMounted()) { 1335 MatrixF mat; 1336 mMount.object->getMountTransform( mMount.node, mMount.xfm, &mat ); 1337 Parent::setTransform(mat); 1338 } 1339} 1340 1341void ShapeBase::advanceTime(F32 dt) 1342{ 1343 // On the client, the shape threads and images are 1344 // advanced at framerate. 1345 advanceThreads(dt); 1346 updateAudioPos(); 1347 for (S32 i = 0; i < MaxMountedImages; i++) 1348 if (mMountedImageList[i].dataBlock) 1349 { 1350 updateImageState(i, dt); 1351 updateImageAnimation(i, dt); 1352 } 1353 1354 // Cloaking 1355 if (mCloaked && mCloakLevel != 1.0) { 1356 if (sCloakSpeed <= 0.0f) 1357 { 1358 // Instantaneous 1359 mCloakLevel = 1.0; 1360 } 1361 else 1362 { 1363 // Over time determined by sCloakSpeed 1364 mCloakLevel += dt / sCloakSpeed; 1365 if (mCloakLevel >= 1.0) 1366 mCloakLevel = 1.0; 1367 } 1368 } else if (!mCloaked && mCloakLevel != 0.0) { 1369 if (sCloakSpeed <= 0.0f) 1370 { 1371 // Instantaneous 1372 mCloakLevel = 0.0; 1373 } 1374 else 1375 { 1376 // Over time determined by sCloakSpeed 1377 mCloakLevel -= dt / sCloakSpeed; 1378 if (mCloakLevel <= 0.0) 1379 mCloakLevel = 0.0; 1380 } 1381 } 1382 if(mFading) 1383 { 1384 mFadeElapsedTime += dt; 1385 if(mFadeElapsedTime > mFadeTime) 1386 { 1387 mFadeVal = F32(!mFadeOut); 1388 mFading = false; 1389 } 1390 else 1391 { 1392 mFadeVal = mFadeElapsedTime / mFadeTime; 1393 if(mFadeOut) 1394 mFadeVal = 1 - mFadeVal; 1395 } 1396 } 1397 1398 if (isMounted()) { 1399 MatrixF mat; 1400 mMount.object->getRenderMountTransform( 0.0f, mMount.node, mMount.xfm, &mat ); 1401 Parent::setRenderTransform(mat); 1402 } 1403} 1404 1405void ShapeBase::setControllingClient( GameConnection* client ) 1406{ 1407 if( isGhost() && gSFX3DWorld ) 1408 { 1409 if( gSFX3DWorld->getListener() == this && !client && getControllingClient() && getControllingClient()->isConnectionToServer() ) 1410 { 1411 // We are the current listener and are no longer a controller object on the 1412 // connection, so clear our listener status. 1413 1414 gSFX3DWorld->setListener( NULL ); 1415 } 1416 else if( client && client->isConnectionToServer() && !getControllingObject() ) 1417 { 1418 // We're on the local client and not controlled by another object, so make 1419 // us the current SFX listener. 1420 1421 gSFX3DWorld->setListener( this ); 1422 } 1423 } 1424 1425 Parent::setControllingClient( client ); 1426 1427 // Update all of the mounted images' shapes so they may 1428 // optimize their animation threads. 1429 for (U32 i=0; i<MaxMountedImages; ++i) 1430 { 1431 MountedImage& image = mMountedImageList[i]; 1432 image.updateDoAnimateAllShapes( this ); 1433 } 1434} 1435 1436void ShapeBase::setControllingObject(ShapeBase* obj) 1437{ 1438 if (obj) { 1439 setProcessTick(false); 1440 // Even though we don't processTick, we still need to 1441 // process after the controller in case anyone is mounted 1442 // on this object. 1443 processAfter(obj); 1444 } 1445 else { 1446 setProcessTick(true); 1447 clearProcessAfter(); 1448 // Catch the case of the controlling object actually 1449 // mounted on this object. 1450 if (mControllingObject->mMount.object == this) 1451 mControllingObject->processAfter(this); 1452 } 1453 mControllingObject = obj; 1454} 1455 1456ShapeBase* ShapeBase::getControlObject() 1457{ 1458 return 0; 1459} 1460 1461void ShapeBase::setControlObject(ShapeBase*) 1462{ 1463} 1464 1465bool ShapeBase::isFirstPerson() const 1466{ 1467 // Always first person as far as the server is concerned. 1468 if (!isGhost()) 1469 return true; 1470 1471 if (const GameConnection* con = getControllingClient()) 1472 return con->getControlObject() == this && con->isFirstPerson(); 1473 return false; 1474} 1475 1476bool ShapeBase::isValidCameraFov(F32 fov) 1477{ 1478 return((fov >= mDataBlock->cameraMinFov) && (fov <= mDataBlock->cameraMaxFov)); 1479} 1480 1481void ShapeBase::setCameraFov(F32 fov) 1482{ 1483 // On server allow for script side checking 1484 if ( !isGhost() && isMethod( "validateCameraFov" ) ) 1485 { 1486 fov = validateCameraFov_callback( fov ); 1487 } 1488 1489 mCameraFov = mClampF(fov, mDataBlock->cameraMinFov, mDataBlock->cameraMaxFov); 1490} 1491 1492void ShapeBase::onCameraScopeQuery(NetConnection *cr, CameraScopeQuery * query) 1493{ 1494 // update the camera query 1495 query->camera = this; 1496 1497 if(GameConnection * con = dynamic_cast<GameConnection*>(cr)) 1498 { 1499 // get the fov from the connection (in deg) 1500 F32 fov; 1501 if (con->getControlCameraFov(&fov)) 1502 { 1503 query->fov = mDegToRad(fov/2); 1504 query->sinFov = mSin(query->fov); 1505 query->cosFov = mCos(query->fov); 1506 } 1507 } 1508 1509 // use eye rather than camera transform (good enough and faster) 1510 MatrixF eyeTransform; 1511 getEyeTransform(&eyeTransform); 1512 eyeTransform.getColumn(3, &query->pos); 1513 eyeTransform.getColumn(1, &query->orientation); 1514 1515 // Get the visible distance. 1516 if (getSceneManager() != NULL) 1517 query->visibleDistance = getSceneManager()->getVisibleDistance(); 1518 1519 Parent::onCameraScopeQuery( cr, query ); 1520} 1521 1522 1523//---------------------------------------------------------------------------- 1524F32 ShapeBase::getEnergyLevel() 1525{ 1526 if ( mDataBlock->inheritEnergyFromMount && mShapeBaseMount ) 1527 return mShapeBaseMount->getEnergyLevel(); 1528 return mEnergy; 1529} 1530 1531F32 ShapeBase::getEnergyValue() 1532{ 1533 if ( mDataBlock->inheritEnergyFromMount && mShapeBaseMount ) 1534 { 1535 F32 maxEnergy = mShapeBaseMount->mDataBlock->maxEnergy; 1536 if ( maxEnergy > 0.f ) 1537 return (mShapeBaseMount->getEnergyLevel() / maxEnergy); 1538 } 1539 else 1540 { 1541 F32 maxEnergy = mDataBlock->maxEnergy; 1542 if ( maxEnergy > 0.f ) 1543 return (mEnergy / mDataBlock->maxEnergy); 1544 } 1545 1546 return 0.0f; 1547} 1548 1549void ShapeBase::setEnergyLevel(F32 energy) 1550{ 1551 if (mDataBlock->inheritEnergyFromMount == false || !mShapeBaseMount) { 1552 if (mDamageState == Enabled) { 1553 mEnergy = (energy > mDataBlock->maxEnergy)? 1554 mDataBlock->maxEnergy: (energy < 0)? 0: energy; 1555 } 1556 } else { 1557 // Pass the set onto whatever we're mounted to... 1558 if ( mShapeBaseMount ) 1559 { 1560 mShapeBaseMount->setEnergyLevel(energy); 1561 } 1562 } 1563} 1564 1565void ShapeBase::setDamageLevel(F32 damage) 1566{ 1567 if (!mDataBlock->isInvincible) { 1568 F32 store = mDamage; 1569 mDamage = mClampF(damage, 0.f, mDataBlock->maxDamage); 1570 1571 if (store != mDamage) { 1572 updateDamageLevel(); 1573 if (isServerObject()) { 1574 setMaskBits(DamageMask); 1575 mDataBlock->onDamage_callback( this, mDamage - store ); 1576 } 1577 } 1578 } 1579} 1580 1581void ShapeBase::updateContainer() 1582{ 1583 PROFILE_SCOPE( ShapeBase_updateContainer ); 1584 1585 // Update container drag and buoyancy properties 1586 1587 // Set default values. 1588 mDrag = mDataBlock->drag; 1589 mBuoyancy = 0.0f; 1590 mGravityMod = 1.0; 1591 mAppliedForce.set(0,0,0); 1592 1593 ContainerQueryInfo info; 1594 info.box = getWorldBox(); 1595 info.mass = getMass(); 1596 1597 mContainer->findObjects(info.box, WaterObjectType</a>|<a href="/coding/file/objecttypes_8h/#objecttypes_8h_1ac18d4a11e9446825e48fd474d7529084a1af121084d5760a7eaef4bb8828ce1cf">PhysicalZoneObjectType,findRouter,&info); 1598 1599 mWaterCoverage = info.waterCoverage; 1600 mLiquidType = info.liquidType; 1601 mLiquidHeight = info.waterHeight; 1602 setCurrentWaterObject( info.waterObject ); 1603 1604 // This value might be useful as a datablock value, 1605 // This is what allows the player to stand in shallow water (below this coverage) 1606 // without jiggling from buoyancy 1607 if (mWaterCoverage >= 0.25f) 1608 { 1609 // water viscosity is used as drag for in water. 1610 // ShapeBaseData drag is used for drag outside of water. 1611 // Combine these two components to calculate this ShapeBase object's 1612 // current drag. 1613 mDrag = ( info.waterCoverage * info.waterViscosity ) + 1614 ( 1.0f - info.waterCoverage ) * mDataBlock->drag; 1615 mBuoyancy = (info.waterDensity / mDataBlock->density) * info.waterCoverage; 1616 } 1617 1618 mAppliedForce = info.appliedForce; 1619 mGravityMod = info.gravityScale; 1620 1621 //Con::printf( "WaterCoverage: %f", mWaterCoverage ); 1622 //Con::printf( "Drag: %f", mDrag ); 1623} 1624 1625 1626//---------------------------------------------------------------------------- 1627 1628void ShapeBase::applyRepair(F32 amount) 1629{ 1630 // Repair increases the repair reserve 1631 if (amount > 0 && ((mRepairReserve += amount) > mDamage)) 1632 mRepairReserve = mDamage; 1633} 1634 1635void ShapeBase::applyDamage(F32 amount) 1636{ 1637 if (amount > 0) 1638 setDamageLevel(mDamage + amount); 1639} 1640 1641F32 ShapeBase::getDamageValue() 1642{ 1643 // Return a 0-1 damage value. 1644 return mDamage / mDataBlock->maxDamage; 1645} 1646 1647F32 ShapeBase::getMaxDamage() 1648{ 1649 return mDataBlock->maxDamage; 1650} 1651 1652void ShapeBase::updateDamageLevel() 1653{ 1654 if (mDamageThread) { 1655 // mDamage is already 0-1 on the client 1656 if (mDamage >= mDataBlock->destroyedLevel) { 1657 if (getDamageState() == Destroyed) 1658 mShapeInstance->setPos(mDamageThread, 0); 1659 else 1660 mShapeInstance->setPos(mDamageThread, 1); 1661 } else { 1662 mShapeInstance->setPos(mDamageThread, mDamage / mDataBlock->destroyedLevel); 1663 } 1664 } 1665} 1666 1667 1668//---------------------------------------------------------------------------- 1669 1670void ShapeBase::setDamageState(DamageState state) 1671{ 1672 if (mDamageState == state) 1673 return; 1674 1675 bool invokeCallback = false; 1676 const char* lastState = 0; 1677 1678 if (!isGhost()) { 1679 if (state != getDamageState()) 1680 setMaskBits(DamageMask); 1681 1682 lastState = getDamageStateName(); 1683 switch (state) { 1684 case Destroyed: { 1685 if (mDamageState == Enabled) 1686 { 1687 setDamageState(Disabled); 1688 1689 // It is possible that the setDamageState() call above has already 1690 // upgraded our state to Destroyed. If that is the case, no need 1691 // to continue. 1692 if (mDamageState == state) 1693 return; 1694 } 1695 invokeCallback = true; 1696 break; 1697 } 1698 case Disabled: 1699 if (mDamageState == Enabled) 1700 invokeCallback = true; 1701 break; 1702 case Enabled: 1703 invokeCallback = true; 1704 break; 1705 default: 1706 AssertFatal(false, "Invalid damage state"); 1707 break; 1708 } 1709 } 1710 1711 mDamageState = state; 1712 if (mDamageState != Enabled) { 1713 mRepairReserve = 0; 1714 mEnergy = 0; 1715 } 1716 if (invokeCallback) { 1717 // Like to call the scripts after the state has been intialize. 1718 // This should only end up being called on the server. 1719 switch (state) { 1720 case Destroyed: 1721 mDataBlock->onDestroyed_callback( this, lastState ); 1722 break; 1723 case Disabled: 1724 mDataBlock->onDisabled_callback( this, lastState ); 1725 break; 1726 case Enabled: 1727 mDataBlock->onEnabled_callback( this, lastState ); 1728 break; 1729 default: 1730 break; 1731 } 1732 } 1733 updateDamageState(); 1734 updateDamageLevel(); 1735} 1736 1737bool ShapeBase::setDamageState(const char* state) 1738{ 1739 for (S32 i = 0; i < NumDamageStates; i++) 1740 if (!dStricmp(state,sDamageStateName[i])) { 1741 setDamageState(DamageState(i)); 1742 return true; 1743 } 1744 return false; 1745} 1746 1747const char* ShapeBase::getDamageStateName() 1748{ 1749 return sDamageStateName[mDamageState]; 1750} 1751 1752void ShapeBase::updateDamageState() 1753{ 1754 if (mHulkThread) { 1755 F32 pos = (mDamageState == Destroyed) ? 1.0f : 0.0f; 1756 if (mShapeInstance->getPos(mHulkThread) != pos) { 1757 mShapeInstance->setPos(mHulkThread,pos); 1758 1759 if (isClientObject()) 1760 mShapeInstance->animate(); 1761 } 1762 } 1763} 1764 1765 1766//---------------------------------------------------------------------------- 1767 1768void ShapeBase::blowUp() 1769{ 1770 Point3F center; 1771 mObjBox.getCenter(¢er); 1772 center += getPosition(); 1773 MatrixF trans = getTransform(); 1774 trans.setPosition( center ); 1775 1776 // explode 1777 Explosion* pExplosion = NULL; 1778 1779 if( pointInWater( (Point3F &)center ) && mDataBlock->underwaterExplosion ) 1780 { 1781 pExplosion = new Explosion; 1782 pExplosion->onNewDataBlock(mDataBlock->underwaterExplosion, false); 1783 } 1784 else 1785 { 1786 if (mDataBlock->explosion) 1787 { 1788 pExplosion = new Explosion; 1789 pExplosion->onNewDataBlock(mDataBlock->explosion, false); 1790 } 1791 } 1792 1793 if( pExplosion ) 1794 { 1795 pExplosion->setTransform(trans); 1796 pExplosion->setInitialState(center, damageDir); 1797 if (pExplosion->registerObject() == false) 1798 { 1799 Con::errorf(ConsoleLogEntry::General, "ShapeBase(%s)::explode: couldn't register explosion", 1800 mDataBlock->getName() ); 1801 delete pExplosion; 1802 pExplosion = NULL; 1803 } 1804 } 1805 1806 TSShapeInstance *debShape = NULL; 1807 1808 if( mDataBlock->debrisShape == NULL ) 1809 { 1810 return; 1811 } 1812 else 1813 { 1814 debShape = new TSShapeInstance( mDataBlock->debrisShape, true); 1815 } 1816 1817 1818 Vector< TSPartInstance *> partList; 1819 TSPartInstance::breakShape( debShape, 0, partList, NULL, NULL, 0 ); 1820 1821 if( !mDataBlock->debris ) 1822 { 1823 mDataBlock->debris = new DebrisData; 1824 } 1825 1826 // cycle through partlist and create debris pieces 1827 for( U32 i=0; i<partList.size(); i++ ) 1828 { 1829 //Point3F axis( 0.0, 0.0, 1.0 ); 1830 Point3F randomDir = MathUtils::randomDir( damageDir, 0, 50 ); 1831 1832 Debris *debris = new Debris; 1833 debris->setPartInstance( partList[i] ); 1834 debris->init( center, randomDir ); 1835 debris->onNewDataBlock( mDataBlock->debris, false ); 1836 debris->setTransform( trans ); 1837 1838 if( !debris->registerObject() ) 1839 { 1840 Con::warnf( ConsoleLogEntry::General, "Could not register debris for class: %s", mDataBlock->getName() ); 1841 delete debris; 1842 debris = NULL; 1843 } 1844 else 1845 { 1846 debShape->incDebrisRefCount(); 1847 } 1848 } 1849 1850 damageDir.set(0, 0, 1); 1851} 1852 1853//---------------------------------------------------------------------------- 1854 1855void ShapeBase::onMount( SceneObject *obj, S32 node ) 1856{ 1857 mConvexList->nukeList(); 1858 1859 // Are we mounting to a ShapeBase object? 1860 mShapeBaseMount = dynamic_cast<ShapeBase*>( obj ); 1861 1862 Parent::onMount( obj, node ); 1863} 1864 1865void ShapeBase::onUnmount( SceneObject *obj, S32 node ) 1866{ 1867 Parent::onUnmount( obj, node ); 1868 1869 mShapeBaseMount = NULL; 1870} 1871 1872Point3F ShapeBase::getAIRepairPoint() 1873{ 1874 if (mDataBlock->mountPointNode[ShapeBaseData::AIRepairNode] < 0) 1875 return Point3F(0, 0, 0); 1876 MatrixF xf(true); 1877 getMountTransform( ShapeBaseData::AIRepairNode, MatrixF::Identity, &xf ); 1878 Point3F pos(0, 0, 0); 1879 xf.getColumn(3,&pos); 1880 return pos; 1881} 1882 1883//---------------------------------------------------------------------------- 1884 1885void ShapeBase::getEyeTransform(MatrixF* mat) 1886{ 1887 getEyeBaseTransform(mat, true); 1888} 1889 1890void ShapeBase::getEyeBaseTransform(MatrixF* mat, bool includeBank) 1891{ 1892 // Returns eye to world space transform 1893 S32 eyeNode = mDataBlock->eyeNode; 1894 if (eyeNode != -1) 1895 mat->mul(getTransform(), mShapeInstance->mNodeTransforms[eyeNode]); 1896 else 1897 *mat = getTransform(); 1898} 1899 1900void ShapeBase::getRenderEyeTransform(MatrixF* mat) 1901{ 1902 getRenderEyeBaseTransform(mat, true); 1903} 1904 1905void ShapeBase::getRenderEyeBaseTransform(MatrixF* mat, bool includeBank) 1906{ 1907 // Returns eye to world space transform 1908 S32 eyeNode = mDataBlock->eyeNode; 1909 if (eyeNode != -1) 1910 mat->mul(getRenderTransform(), mShapeInstance->mNodeTransforms[eyeNode]); 1911 else 1912 *mat = getRenderTransform(); 1913} 1914 1915void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat) 1916{ 1917 // Returns camera to world space transform 1918 // Handles first person / third person camera position 1919 1920 if (isServerObject() && mShapeInstance) 1921 mShapeInstance->animateNodeSubtrees(true); 1922 1923 if (*pos != 0) 1924 { 1925 F32 min,max; 1926 Point3F offset; 1927 MatrixF eye,rot; 1928 getCameraParameters(&min,&max,&offset,&rot); 1929 getRenderEyeTransform(&eye); 1930 mat->mul(eye,rot); 1931 1932 // Use the eye transform to orient the camera 1933 VectorF vp,vec; 1934 vp.x = vp.z = 0; 1935 vp.y = -(max - min) * *pos; 1936 eye.mulV(vp,&vec); 1937 1938 VectorF minVec; 1939 vp.y = -min; 1940 eye.mulV( vp, &minVec ); 1941 1942 // Use the camera node's pos. 1943 Point3F osp,sp; 1944 if (mDataBlock->cameraNode != -1) { 1945 mShapeInstance->mNodeTransforms[mDataBlock->cameraNode].getColumn(3,&osp); 1946 1947 // Scale the camera position before applying the transform 1948 const Point3F& scale = getScale(); 1949 osp.convolve( scale ); 1950 1951 getRenderTransform().mulP(osp,&sp); 1952 } 1953 else 1954 getRenderTransform().getColumn(3,&sp); 1955 1956 // Make sure we don't extend the camera into anything solid 1957 Point3F ep = sp + minVec + vec + offset; 1958 disableCollision(); 1959 if (isMounted()) 1960 getObjectMount()->disableCollision(); 1961 RayInfo collision; 1962 if( mContainer && mContainer->castRay(sp, ep, 1963 (0xFFFFFFFF & ~(WaterObjectType | 1964 GameBaseObjectType | 1965 TriggerObjectType | 1966 DefaultObjectType)), 1967 &collision) == true) { 1968 F32 vecLenSq = vec.lenSquared(); 1969 F32 adj = (-mDot(vec, collision.normal) / vecLenSq) * 0.1; 1970 F32 newPos = getMax(0.0f, collision.t - adj); 1971 if (newPos == 0.0f) 1972 eye.getColumn(3,&ep); 1973 else 1974 ep = sp + offset + (vec * newPos); 1975 } 1976 mat->setColumn(3,ep); 1977 if (isMounted()) 1978 getObjectMount()->enableCollision(); 1979 enableCollision(); 1980 } 1981 else 1982 { 1983 getRenderEyeTransform(mat); 1984 } 1985 1986 // Apply Camera FX. 1987 mat->mul( gCamFXMgr.getTrans() ); 1988} 1989 1990void ShapeBase::getEyeCameraTransform(IDisplayDevice *displayDevice, U32 eyeId, MatrixF *outMat) 1991{ 1992 MatrixF temp(1); 1993 Point3F eyePos; 1994 Point3F rotEyePos; 1995 1996 DisplayPose newPose; 1997 displayDevice->getFrameEyePose(&newPose, eyeId); 1998 1999 // Ok, basically we just need to add on newPose to the camera transform 2000 // NOTE: currently we dont support third-person camera in this mode 2001 MatrixF cameraTransform(1); 2002 F32 fakePos = 0; 2003 //cameraTransform = getRenderTransform(); // use this for controllers TODO 2004 getCameraTransform(&fakePos, &cameraTransform); 2005 2006 temp = MatrixF(1); 2007 newPose.orientation.setMatrix(&temp); 2008 temp.setPosition(newPose.position); 2009 2010 *outMat = cameraTransform * temp; 2011} 2012 2013void ShapeBase::getCameraParameters(F32 *min,F32* max,Point3F* off,MatrixF* rot) 2014{ 2015 *min = mDataBlock->cameraMinDist; 2016 *max = mDataBlock->cameraMaxDist; 2017 off->set(0,0,0); 2018 rot->identity(); 2019} 2020 2021//---------------------------------------------------------------------------- 2022F32 ShapeBase::getDamageFlash() const 2023{ 2024 return mDamageFlash; 2025} 2026 2027void ShapeBase::setDamageFlash(const F32 flash) 2028{ 2029 mDamageFlash = flash; 2030 if (mDamageFlash < 0.0) 2031 mDamageFlash = 0; 2032 else if (mDamageFlash > 1.0) 2033 mDamageFlash = 1.0; 2034} 2035 2036 2037//---------------------------------------------------------------------------- 2038F32 ShapeBase::getWhiteOut() const 2039{ 2040 return mWhiteOut; 2041} 2042 2043void ShapeBase::setWhiteOut(const F32 flash) 2044{ 2045 mWhiteOut = flash; 2046 if (mWhiteOut < 0.0) 2047 mWhiteOut = 0; 2048 else if (mWhiteOut > 1.5) 2049 mWhiteOut = 1.5; 2050} 2051 2052 2053//---------------------------------------------------------------------------- 2054 2055bool ShapeBase::onlyFirstPerson() const 2056{ 2057 return mDataBlock->firstPersonOnly; 2058} 2059 2060bool ShapeBase::useObjsEyePoint() const 2061{ 2062 return mDataBlock->useEyePoint; 2063} 2064 2065//---------------------------------------------------------------------------- 2066void ShapeBase::setVelocity(const VectorF&) 2067{ 2068} 2069 2070void ShapeBase::applyImpulse(const Point3F&,const VectorF&) 2071{ 2072} 2073 2074 2075//---------------------------------------------------------------------------- 2076 2077void ShapeBase::playAudio(U32 slot,SFXTrack* profile) 2078{ 2079 AssertFatal( slot < MaxSoundThreads, "ShapeBase::playAudio() bad slot index" ); 2080 Sound& st = mSoundThread[slot]; 2081 if( profile && ( !st.play || st.profile != profile ) ) 2082 { 2083 setMaskBits(SoundMaskN << slot); 2084 st.play = true; 2085 st.profile = profile; 2086 updateAudioState(st); 2087 } 2088} 2089 2090void ShapeBase::stopAudio(U32 slot) 2091{ 2092 AssertFatal( slot < MaxSoundThreads, "ShapeBase::stopAudio() bad slot index" ); 2093 2094 Sound& st = mSoundThread[slot]; 2095 if ( st.play ) 2096 { 2097 st.play = false; 2098 setMaskBits(SoundMaskN << slot); 2099 updateAudioState(st); 2100 } 2101} 2102 2103void ShapeBase::updateServerAudio() 2104{ 2105 // Timeout non-looping sounds 2106 for (S32 i = 0; i < MaxSoundThreads; i++) { 2107 Sound& st = mSoundThread[i]; 2108 if (st.play && st.timeout && st.timeout < Sim::getCurrentTime()) { 2109 clearMaskBits(SoundMaskN << i); 2110 st.play = false; 2111 } 2112 } 2113} 2114 2115void ShapeBase::updateAudioState(Sound& st) 2116{ 2117 SFX_DELETE( st.sound ); 2118 2119 if ( st.play && st.profile ) 2120 { 2121 if ( isGhost() ) 2122 { 2123 if ( Sim::findObject( SimObjectId((uintptr_t)st.profile), st.profile ) ) 2124 { 2125 st.sound = SFX->createSource( st.profile, &getTransform() ); 2126 if ( st.sound ) 2127 st.sound->play(); 2128 } 2129 else 2130 st.play = false; 2131 } 2132 else 2133 { 2134 // Non-looping sounds timeout on the server 2135 st.timeout = 0; 2136 if ( !st.profile->getDescription()->mIsLooping ) 2137 st.timeout = Sim::getCurrentTime() + sAudioTimeout; 2138 } 2139 } 2140 else 2141 st.play = false; 2142} 2143 2144void ShapeBase::updateAudioPos() 2145{ 2146 for (S32 i = 0; i < MaxSoundThreads; i++) 2147 { 2148 SFXSource* source = mSoundThread[i].sound; 2149 if ( source ) 2150 source->setTransform( getTransform() ); 2151 } 2152} 2153 2154//---------------------------------------------------------------------------- 2155 2156const char *ShapeBase::getThreadSequenceName( U32 slot ) 2157{ 2158 Thread& st = mScriptThread[slot]; 2159 if ( st.sequence == -1 ) 2160 { 2161 // Invalid Animation. 2162 return ""; 2163 } 2164 2165 // Name Index 2166 const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex; 2167 2168 // Return Name. 2169 return getShape()->getName( nameIndex ); 2170} 2171 2172bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) 2173{ 2174 Thread& st = mScriptThread[slot]; 2175 if (st.thread && st.sequence == seq && st.state == Thread::Play) 2176 return true; 2177 2178 // Handle a -1 sequence, as this may be set when a thread has been destroyed. 2179 if(seq == -1) 2180 return true; 2181 2182 if (seq < MaxSequenceIndex) { 2183 setMaskBits(ThreadMaskN << slot); 2184 st.sequence = seq; 2185 if (reset) { 2186 st.state = Thread::Play; 2187 st.atEnd = false; 2188 st.timescale = 1.f; 2189 st.position = 0.f; 2190 } 2191 if (mShapeInstance) { 2192 if (!st.thread) 2193 st.thread = mShapeInstance->addThread(); 2194 mShapeInstance->setSequence(st.thread,seq,st.position); 2195 updateThread(st); 2196 } 2197 return true; 2198 } 2199 return false; 2200} 2201 2202void ShapeBase::updateThread(Thread& st) 2203{ 2204 switch (st.state) 2205 { 2206 case Thread::Stop: 2207 { 2208 mShapeInstance->setTimeScale( st.thread, 1.f ); 2209 mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); 2210 } // Drop through to pause state 2211 2212 case Thread::Pause: 2213 { 2214 mShapeInstance->setTimeScale( st.thread, 0.f ); 2215 } break; 2216 2217 case Thread::Play: 2218 { 2219 if (st.atEnd) 2220 { 2221 mShapeInstance->setTimeScale(st.thread,1); 2222 mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); 2223 mShapeInstance->setTimeScale(st.thread,0); 2224 st.state = Thread::Stop; 2225 } 2226 else 2227 { 2228 if ( st.position != -1.f ) 2229 { 2230 mShapeInstance->setTimeScale( st.thread, 1.f ); 2231 mShapeInstance->setPos( st.thread, st.position ); 2232 } 2233 2234 mShapeInstance->setTimeScale(st.thread, st.timescale ); 2235 } 2236 } break; 2237 2238 case Thread::Destroy: 2239 { 2240 st.atEnd = true; 2241 st.sequence = -1; 2242 if(st.thread) 2243 { 2244 mShapeInstance->destroyThread(st.thread); 2245 st.thread = 0; 2246 } 2247 } break; 2248 } 2249} 2250 2251bool ShapeBase::stopThread(U32 slot) 2252{ 2253 Thread& st = mScriptThread[slot]; 2254 if (st.sequence != -1 && st.state != Thread::Stop) { 2255 setMaskBits(ThreadMaskN << slot); 2256 st.state = Thread::Stop; 2257 updateThread(st); 2258 return true; 2259 } 2260 return false; 2261} 2262 2263bool ShapeBase::destroyThread(U32 slot) 2264{ 2265 Thread& st = mScriptThread[slot]; 2266 if (st.sequence != -1 && st.state != Thread::Destroy) { 2267 setMaskBits(ThreadMaskN << slot); 2268 st.state = Thread::Destroy; 2269 updateThread(st); 2270 return true; 2271 } 2272 return false; 2273} 2274 2275bool ShapeBase::pauseThread(U32 slot) 2276{ 2277 Thread& st = mScriptThread[slot]; 2278 if (st.sequence != -1 && st.state != Thread::Pause) { 2279 setMaskBits(ThreadMaskN << slot); 2280 st.state = Thread::Pause; 2281 updateThread(st); 2282 return true; 2283 } 2284 return false; 2285} 2286 2287bool ShapeBase::playThread(U32 slot) 2288{ 2289 Thread& st = mScriptThread[slot]; 2290 if (st.sequence != -1 && st.state != Thread::Play) { 2291 setMaskBits(ThreadMaskN << slot); 2292 st.state = Thread::Play; 2293 updateThread(st); 2294 return true; 2295 } 2296 return false; 2297} 2298 2299bool ShapeBase::setThreadPosition( U32 slot, F32 pos ) 2300{ 2301 Thread& st = mScriptThread[slot]; 2302 if (st.sequence != -1) 2303 { 2304 setMaskBits(ThreadMaskN << slot); 2305 st.position = pos; 2306 st.atEnd = false; 2307 updateThread(st); 2308 2309 return true; 2310 } 2311 return false; 2312} 2313 2314bool ShapeBase::setThreadDir(U32 slot,bool forward) 2315{ 2316 Thread& st = mScriptThread[slot]; 2317 if (st.sequence != -1) 2318 { 2319 if ( ( st.timescale >= 0.f ) != forward ) 2320 { 2321 setMaskBits(ThreadMaskN << slot); 2322 st.timescale *= -1.f ; 2323 st.atEnd = false; 2324 updateThread(st); 2325 } 2326 return true; 2327 } 2328 return false; 2329} 2330 2331bool ShapeBase::setThreadTimeScale( U32 slot, F32 timeScale ) 2332{ 2333 Thread& st = mScriptThread[slot]; 2334 if (st.sequence != -1) 2335 { 2336 if (st.timescale != timeScale) 2337 { 2338 setMaskBits(ThreadMaskN << slot); 2339 st.timescale = timeScale; 2340 updateThread(st); 2341 } 2342 return true; 2343 } 2344 return false; 2345} 2346 2347void ShapeBase::advanceThreads(F32 dt) 2348{ 2349 for (U32 i = 0; i < MaxScriptThreads; i++) { 2350 Thread& st = mScriptThread[i]; 2351 if (st.thread) { 2352 if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd && 2353 ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0: 2354 mShapeInstance->getPos(st.thread) <= 0)) { 2355 st.atEnd = true; 2356 updateThread(st); 2357 if (!isGhost()) { 2358 mDataBlock->onEndSequence_callback(this, i, this->getThreadSequenceName(i)); 2359 } 2360 } 2361 2362 // Make sure the thread is still valid after the call to onEndSequence_callback(). 2363 // Someone could have called destroyThread() while in there. 2364 if(st.thread) 2365 { 2366 mShapeInstance->advanceTime(dt,st.thread); 2367 st.position = mShapeInstance->getPos(st.thread); 2368 } 2369 } 2370 } 2371} 2372 2373//---------------------------------------------------------------------------- 2374 2375/// Emit particles on the given emitter, if we're within triggerHeight above some static surface with a 2376/// material that has 'showDust' set to true. The particles will have a lifetime of 'numMilliseconds' 2377/// and be emitted at the given offset from the contact point having a direction of 'axis'. 2378 2379void ShapeBase::emitDust( ParticleEmitter* emitter, F32 triggerHeight, const Point3F& offset, U32 numMilliseconds, const Point3F& axis ) 2380{ 2381 if( !emitter ) 2382 return; 2383 2384 Point3F startPos = getPosition(); 2385 Point3F endPos = startPos + Point3F( 0.0, 0.0, - triggerHeight ); 2386 2387 RayInfo rayInfo; 2388 if( getContainer()->castRay( startPos, endPos, STATIC_COLLISION_TYPEMASK, &rayInfo ) ) 2389 { 2390 Material* material = ( rayInfo.material ? dynamic_cast< Material* >( rayInfo.material->getMaterial() ) : 0 ); 2391 if( material && material->mShowDust ) 2392 { 2393 ColorF colorList[ ParticleData::PDC_NUM_KEYS ]; 2394 2395 for( U32 x = 0; x < getMin( Material::NUM_EFFECT_COLOR_STAGES, ParticleData::PDC_NUM_KEYS ); ++ x ) 2396 colorList[ x ] = material->mEffectColor[ x ]; 2397 for( U32 x = Material::NUM_EFFECT_COLOR_STAGES; x < ParticleData::PDC_NUM_KEYS; ++ x ) 2398 colorList[ x ].set( 1.0, 1.0, 1.0, 0.0 ); 2399 2400 emitter->setColors( colorList ); 2401 2402 Point3F contactPoint = rayInfo.point + offset; 2403 emitter->emitParticles( contactPoint, true, ( axis == Point3F::Zero ? rayInfo.normal : axis ), 2404 getVelocity(), numMilliseconds ); 2405 } 2406 } 2407} 2408 2409//---------------------------------------------------------------------------- 2410 2411TSShape const* ShapeBase::getShape() 2412{ 2413 return mShapeInstance? mShapeInstance->getShape(): 0; 2414} 2415 2416void ShapeBase::prepRenderImage( SceneRenderState *state ) 2417{ 2418 _prepRenderImage( state, true, true ); 2419} 2420 2421void ShapeBase::_prepRenderImage( SceneRenderState *state, 2422 bool renderSelf, 2423 bool renderMountedImages ) 2424{ 2425 PROFILE_SCOPE( ShapeBase_PrepRenderImage ); 2426 2427 //if ( mIsCubemapUpdate ) 2428 // return false; 2429 2430 if( ( getDamageState() == Destroyed ) && ( !mDataBlock->renderWhenDestroyed ) ) 2431 return; 2432 2433 // We don't need to render if all the meshes are forced hidden. 2434 if ( mMeshHidden.getSize() > 0 && mMeshHidden.testAll() ) 2435 return; 2436 2437 // If we're rendering shadows don't render the mounted 2438 // images unless the shape is also rendered. 2439 if ( state->isShadowPass() && !renderSelf ) 2440 return; 2441 2442 // If we're currently rendering our own reflection we 2443 // don't want to render ourselves into it. 2444 if ( mCubeReflector.isRendering() ) 2445 return; 2446 2447 // We force all the shapes to use the highest detail 2448 // if we're the control object or mounted. 2449 bool forceHighestDetail = false; 2450 { 2451 GameConnection *con = GameConnection::getConnectionToServer(); 2452 ShapeBase *co = NULL; 2453 if(con && ( (co = dynamic_cast<ShapeBase*>(con->getControlObject())) != NULL) ) 2454 { 2455 if(co == this || co->getObjectMount() == this) 2456 forceHighestDetail = true; 2457 } 2458 } 2459 2460 mLastRenderFrame = sLastRenderFrame; 2461 2462 // get shape detail...we might not even need to be drawn 2463 Point3F cameraOffset = getWorldBox().getClosestPoint( state->getDiffuseCameraPosition() ) - state->getDiffuseCameraPosition(); 2464 F32 dist = cameraOffset.len(); 2465 if (dist < 0.01f) 2466 dist = 0.01f; 2467 2468 F32 invScale = (1.0f/getMax(getMax(mObjScale.x,mObjScale.y),mObjScale.z)); 2469 2470 if (mShapeInstance) 2471 { 2472 if ( forceHighestDetail ) 2473 mShapeInstance->setCurrentDetail( 0 ); 2474 else 2475 mShapeInstance->setDetailFromDistance( state, dist * invScale ); 2476 2477 mShapeInstance->animate(); 2478 } 2479 2480 if ( ( mShapeInstance && mShapeInstance->getCurrentDetail() < 0 ) || 2481 ( !mShapeInstance && !gShowBoundingBox ) ) 2482 { 2483 // no, don't draw anything 2484 return; 2485 } 2486 2487 if( renderMountedImages ) 2488 { 2489 for (U32 i = 0; i < MaxMountedImages; i++) 2490 { 2491 MountedImage& image = mMountedImageList[i]; 2492 U32 imageShapeIndex = getImageShapeIndex(image); 2493 if (image.dataBlock && image.shapeInstance[imageShapeIndex]) 2494 { 2495 // Select detail levels on mounted items but... always 2496 // draw the control object's mounted images in high detail. 2497 if ( forceHighestDetail ) 2498 image.shapeInstance[imageShapeIndex]->setCurrentDetail( 0 ); 2499 else 2500 image.shapeInstance[imageShapeIndex]->setDetailFromDistance( state, dist * invScale ); 2501 2502 if (!mIsZero( (1.0f - mCloakLevel) * mFadeVal)) 2503 { 2504 prepBatchRender( state, i ); 2505 2506 // Debug rendering of the mounted shape bounds. 2507 if ( gShowBoundingBox ) 2508 { 2509 ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>(); 2510 ri->renderDelegate.bind( this, &ShapeBase::_renderBoundingBox ); 2511 ri->objectIndex = i; 2512 ri->type = RenderPassManager::RIT_Editor; 2513 state->getRenderPass()->addInst( ri ); 2514 } 2515 } 2516 } 2517 } 2518 } 2519 2520 // Debug rendering of the shape bounding box. 2521 if ( gShowBoundingBox ) 2522 { 2523 ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>(); 2524 ri->renderDelegate.bind( this, &ShapeBase::_renderBoundingBox ); 2525 ri->objectIndex = -1; 2526 ri->type = RenderPassManager::RIT_Editor; 2527 state->getRenderPass()->addInst( ri ); 2528 } 2529 2530 if ( mShapeInstance && renderSelf ) 2531 prepBatchRender( state, -1 ); 2532 2533 calcClassRenderData(); 2534} 2535 2536//---------------------------------------------------------------------------- 2537// prepBatchRender 2538//---------------------------------------------------------------------------- 2539void ShapeBase::prepBatchRender(SceneRenderState* state, S32 mountedImageIndex ) 2540{ 2541 // CHANGES IN HERE SHOULD BE DUPLICATED IN TSSTATIC! 2542 2543 GFXTransformSaver saver; 2544 2545 // Set up our TS render state. 2546 TSRenderState rdata; 2547 rdata.setSceneState( state ); 2548 if ( mCubeReflector.isEnabled() ) 2549 rdata.setCubemap( mCubeReflector.getCubemap() ); 2550 rdata.setFadeOverride( (1.0f - mCloakLevel) * mFadeVal ); 2551 2552 // We might have some forward lit materials 2553 // so pass down a query to gather lights. 2554 LightQuery query; 2555 query.init( getWorldSphere() ); 2556 rdata.setLightQuery( &query ); 2557 2558 if( mountedImageIndex != -1 ) 2559 { 2560 MountedImage& image = mMountedImageList[mountedImageIndex]; 2561 2562 if( image.dataBlock && image.shapeInstance ) 2563 { 2564 renderMountedImage( mountedImageIndex, rdata, state ); 2565 } 2566 } 2567 else 2568 { 2569 MatrixF mat = getRenderTransform(); 2570 mat.scale( mObjScale ); 2571 GFX->setWorldMatrix( mat ); 2572 2573 if ( state->isDiffusePass() && mCubeReflector.isEnabled() && mCubeReflector.getOcclusionQuery() ) 2574 { 2575 RenderPassManager *pass = state->getRenderPass(); 2576 2577 OccluderRenderInst *ri = pass->allocInst<OccluderRenderInst>(); 2578 2579 ri->type = RenderPassManager::RIT_Occluder; 2580 ri->query = mCubeReflector.getOcclusionQuery(); 2581 mObjToWorld.mulP( mObjBox.getCenter(), &ri->position ); 2582 ri->scale.set( mObjBox.getExtents() ); 2583 ri->orientation = pass->allocUniqueXform( mObjToWorld ); 2584 ri->isSphere = false; 2585 state->getRenderPass()->addInst( ri ); 2586 } 2587 2588 mShapeInstance->animate(); 2589 mShapeInstance->render( rdata ); 2590 } 2591} 2592 2593void ShapeBase::renderMountedImage( U32 imageSlot, TSRenderState &rstate, SceneRenderState *state ) 2594{ 2595 GFX->pushWorldMatrix(); 2596 2597 MatrixF mat; 2598 getRenderImageTransform(imageSlot, &mat, rstate.getSceneState()->isShadowPass()); 2599 GFX->setWorldMatrix( mat ); 2600 2601 MountedImage& image = mMountedImageList[imageSlot]; 2602 U32 imageShapeIndex = getImageShapeIndex(image); 2603 image.shapeInstance[imageShapeIndex]->animate(); 2604 image.shapeInstance[imageShapeIndex]->render( rstate ); 2605 2606 GFX->popWorldMatrix(); 2607} 2608 2609void ShapeBase::_renderBoundingBox( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat ) 2610{ 2611 // If we got an override mat then this some 2612 // special rendering pass... skip out of it. 2613 if ( overrideMat ) 2614 return; 2615 2616 GFXStateBlockDesc desc; 2617 desc.setZReadWrite( true, false ); 2618 desc.setBlend( true ); 2619 desc.fillMode = GFXFillWireframe; 2620 2621 GFXDrawUtil *drawer = GFX->getDrawUtil(); 2622 2623 if ( ri->objectIndex != -1 ) 2624 { 2625 MountedImage &image = mMountedImageList[ ri->objectIndex ]; 2626 2627 if ( image.shapeInstance ) 2628 { 2629 MatrixF mat; 2630 getRenderImageTransform( ri->objectIndex, &mat ); 2631 2632 const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->bounds; 2633 2634 drawer->drawCube( desc, objBox, ColorI( 255, 255, 255 ), &mat ); 2635 } 2636 } 2637 else 2638 drawer->drawCube( desc, mObjBox, ColorI( 255, 255, 255 ), &mRenderObjToWorld ); 2639} 2640 2641bool ShapeBase::castRay(const Point3F &start, const Point3F &end, RayInfo* info) 2642{ 2643 if (mShapeInstance) 2644 { 2645 RayInfo shortest; 2646 shortest.t = 1e8; 2647 2648 info->object = NULL; 2649 for (U32 i = 0; i < mDataBlock->LOSDetails.size(); i++) 2650 { 2651 mShapeInstance->animate(mDataBlock->LOSDetails[i]); 2652 if (mShapeInstance->castRay(start, end, info, mDataBlock->LOSDetails[i])) 2653 { 2654 info->object = this; 2655 if (info->t < shortest.t) 2656 shortest = *info; 2657 } 2658 } 2659 2660 if (info->object == this) 2661 { 2662 // Copy out the shortest time... 2663 *info = shortest; 2664 return true; 2665 } 2666 } 2667 2668 return false; 2669} 2670 2671bool ShapeBase::castRayRendered(const Point3F &start, const Point3F &end, RayInfo* info) 2672{ 2673 if (mShapeInstance) 2674 { 2675 RayInfo localInfo; 2676 mShapeInstance->animate(); 2677 bool res = mShapeInstance->castRayRendered(start, end, &localInfo, mShapeInstance->getCurrentDetail()); 2678 if (res) 2679 { 2680 *info = localInfo; 2681 info->object = this; 2682 return true; 2683 } 2684 } 2685 2686 return false; 2687} 2688 2689 2690//---------------------------------------------------------------------------- 2691 2692bool ShapeBase::buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &, const SphereF &) 2693{ 2694 if ( !mShapeInstance ) 2695 return false; 2696 2697 polyList->setTransform(&mObjToWorld, mObjScale); 2698 polyList->setObject(this); 2699 2700 if ( context == PLC_Selection ) 2701 { 2702 mShapeInstance->animate(); 2703 mShapeInstance->buildPolyList(polyList,mShapeInstance->getCurrentDetail()); 2704 return true; 2705 } 2706 else if ( context == PLC_Export ) 2707 { 2708 // Try to call on the client so we can export materials 2709 ShapeBase* exportObj = this; 2710 if ( isServerObject() && getClientObject() ) 2711 exportObj = dynamic_cast<ShapeBase*>(getClientObject()); 2712 2713 S32 dl = 0; 2714 exportObj->mShapeInstance->animate(); 2715 exportObj->mShapeInstance->buildPolyList(polyList, dl); 2716 return true; 2717 } 2718 else 2719 { 2720 bool ret = false; 2721 for (U32 i = 0; i < mDataBlock->collisionDetails.size(); i++) 2722 { 2723 mShapeInstance->buildPolyList(polyList,mDataBlock->collisionDetails[i]); 2724 ret = true; 2725 } 2726 2727 return ret; 2728 } 2729} 2730 2731void ShapeBase::buildConvex(const Box3F& box, Convex* convex) 2732{ 2733 if (mShapeInstance == NULL) 2734 return; 2735 2736 // These should really come out of a pool 2737 mConvexList->collectGarbage(); 2738 2739 Box3F realBox = box; 2740 mWorldToObj.mul(realBox); 2741 realBox.minExtents.convolveInverse(mObjScale); 2742 realBox.maxExtents.convolveInverse(mObjScale); 2743 2744 if (realBox.isOverlapped(getObjBox()) == false) 2745 return; 2746 2747 for (U32 i = 0; i < mDataBlock->collisionDetails.size(); i++) 2748 { 2749 Box3F newbox = mDataBlock->collisionBounds[i]; 2750 newbox.minExtents.convolve(mObjScale); 2751 newbox.maxExtents.convolve(mObjScale); 2752 mObjToWorld.mul(newbox); 2753 if (box.isOverlapped(newbox) == false) 2754 continue; 2755 2756 // See if this hull exists in the working set already... 2757 Convex* cc = 0; 2758 CollisionWorkingList& wl = convex->getWorkingList(); 2759 for (CollisionWorkingList* itr = wl.wLink.mNext; itr != &wl; itr = itr->wLink.mNext) { 2760 if (itr->mConvex->getType() == ShapeBaseConvexType && 2761 (static_cast<ShapeBaseConvex*>(itr->mConvex)->pShapeBase == this && 2762 static_cast<ShapeBaseConvex*>(itr->mConvex)->hullId == i)) { 2763 cc = itr->mConvex; 2764 break; 2765 } 2766 } 2767 if (cc) 2768 continue; 2769 2770 // Create a new convex. 2771 ShapeBaseConvex* cp = new ShapeBaseConvex; 2772 mConvexList->registerObject(cp); 2773 convex->addToWorkingList(cp); 2774 cp->mObject = this; 2775 cp->pShapeBase = this; 2776 cp->hullId = i; 2777 cp->box = mDataBlock->collisionBounds[i]; 2778 cp->transform = 0; 2779 cp->findNodeTransform(); 2780 } 2781} 2782 2783 2784//---------------------------------------------------------------------------- 2785 2786void ShapeBase::queueCollision( SceneObject *obj, const VectorF &vec) 2787{ 2788 // Add object to list of collisions. 2789 SimTime time = Sim::getCurrentTime(); 2790 S32 num = obj->getId(); 2791 2792 CollisionTimeout** adr = &mTimeoutList; 2793 CollisionTimeout* ptr = mTimeoutList; 2794 while (ptr) { 2795 if (ptr->objectNumber == num) { 2796 if (ptr->expireTime < time) { 2797 ptr->expireTime = time + CollisionTimeoutValue; 2798 ptr->object = obj; 2799 ptr->vector = vec; 2800 } 2801 return; 2802 } 2803 // Recover expired entries 2804 if (ptr->expireTime < time) { 2805 CollisionTimeout* cur = ptr; 2806 *adr = ptr->next; 2807 ptr = ptr->next; 2808 cur->next = sFreeTimeoutList; 2809 sFreeTimeoutList = cur; 2810 } 2811 else { 2812 adr = &ptr->next; 2813 ptr = ptr->next; 2814 } 2815 } 2816 2817 // New entry for the object 2818 if (sFreeTimeoutList != NULL) 2819 { 2820 ptr = sFreeTimeoutList; 2821 sFreeTimeoutList = ptr->next; 2822 ptr->next = NULL; 2823 } 2824 else 2825 { 2826 ptr = sTimeoutChunker.alloc(); 2827 } 2828 2829 ptr->object = obj; 2830 ptr->objectNumber = obj->getId(); 2831 ptr->vector = vec; 2832 ptr->expireTime = time + CollisionTimeoutValue; 2833 ptr->next = mTimeoutList; 2834 2835 mTimeoutList = ptr; 2836} 2837 2838void ShapeBase::notifyCollision() 2839{ 2840 // Notify all the objects that were just stamped during the queueing 2841 // process. 2842 SimTime expireTime = Sim::getCurrentTime() + CollisionTimeoutValue; 2843 for (CollisionTimeout* ptr = mTimeoutList; ptr; ptr = ptr->next) 2844 { 2845 if (ptr->expireTime == expireTime && ptr->object) 2846 { 2847 SimObjectPtr<SceneObject> safePtr(ptr->object); 2848 SimObjectPtr<ShapeBase> safeThis(this); 2849 onCollision(ptr->object,ptr->vector); 2850 ptr->object = 0; 2851 2852 if(!bool(safeThis)) 2853 return; 2854 2855 if(bool(safePtr)) 2856 safePtr->onCollision(this,ptr->vector); 2857 2858 if(!bool(safeThis)) 2859 return; 2860 } 2861 } 2862} 2863 2864void ShapeBase::onCollision( SceneObject *object, const VectorF &vec ) 2865{ 2866 if (!isGhost()) 2867 mDataBlock->onCollision_callback( this, object, vec, vec.len() ); 2868} 2869 2870//-------------------------------------------------------------------------- 2871bool ShapeBase::pointInWater( Point3F &point ) 2872{ 2873 if ( mCurrentWaterObject == NULL ) 2874 return false; 2875 2876 return mCurrentWaterObject->isUnderwater( point ); 2877} 2878 2879//---------------------------------------------------------------------------- 2880 2881void ShapeBase::writePacketData(GameConnection *connection, BitStream *stream) 2882{ 2883 Parent::writePacketData(connection, stream); 2884 2885 stream->write(getEnergyLevel()); 2886 stream->write(mRechargeRate); 2887} 2888 2889void ShapeBase::readPacketData(GameConnection *connection, BitStream *stream) 2890{ 2891 Parent::readPacketData(connection, stream); 2892 2893 F32 energy; 2894 stream->read(&energy); 2895 setEnergyLevel(energy); 2896 2897 stream->read(&mRechargeRate); 2898} 2899 2900F32 ShapeBase::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 updateSkips) 2901{ 2902 // If it's the scope object, must be high priority 2903 if (camInfo->camera == this) { 2904 // Most priorities are between 0 and 1, so this 2905 // should be something larger. 2906 return 10.0f; 2907 } 2908 if( camInfo->camera ) 2909 { 2910 ShapeBase* camera = dynamic_cast< ShapeBase* >( camInfo->camera ); 2911 // see if the camera is mounted to this... 2912 // if it is, this should have a high priority 2913 if( camera && camera->getObjectMount() == this) 2914 return 10.0f; 2915 } 2916 return Parent::getUpdatePriority(camInfo, updateMask, updateSkips); 2917} 2918 2919U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream) 2920{ 2921 U32 retMask = Parent::packUpdate(con, mask, stream); 2922 2923 if (mask & InitialUpdateMask) { 2924 // mask off sounds that aren't playing 2925 S32 i; 2926 for (i = 0; i < MaxSoundThreads; i++) 2927 if (!mSoundThread[i].play) 2928 mask &= ~(SoundMaskN << i); 2929 2930 // mask off threads that aren't running 2931 for (i = 0; i < MaxScriptThreads; i++) 2932 if (mScriptThread[i].sequence == -1) 2933 mask &= ~(ThreadMaskN << i); 2934 2935 // mask off images that aren't updated 2936 for(i = 0; i < MaxMountedImages; i++) 2937 if(!mMountedImageList[i].dataBlock) 2938 mask &= ~(ImageMaskN << i); 2939 } 2940 2941 if(!stream->writeFlag(mask & (NameMask | DamageMask | SoundMask | MeshHiddenMask | 2942 ThreadMask | ImageMask | CloakMask | SkinMask))) 2943 return retMask; 2944 2945 if (stream->writeFlag(mask & DamageMask)) { 2946 stream->writeFloat(mClampF(mDamage / mDataBlock->maxDamage, 0.f, 1.f), DamageLevelBits); 2947 stream->writeInt(mDamageState,NumDamageStateBits); 2948 stream->writeNormalVector( damageDir, 8 ); 2949 } 2950 2951 if (stream->writeFlag(mask & ThreadMask)) { 2952 for (S32 i = 0; i < MaxScriptThreads; i++) { 2953 Thread& st = mScriptThread[i]; 2954 if (stream->writeFlag( (st.sequence != -1 || st.state == Thread::Destroy) && (mask & (ThreadMaskN << i)) ) ) { 2955 stream->writeInt(st.sequence,ThreadSequenceBits); 2956 stream->writeInt(st.state,2); 2957 stream->write(st.timescale); 2958 stream->write(st.position); 2959 stream->writeFlag(st.atEnd); 2960 } 2961 } 2962 } 2963 2964 if (stream->writeFlag(mask & SoundMask)) { 2965 for (S32 i = 0; i < MaxSoundThreads; i++) { 2966 Sound& st = mSoundThread[i]; 2967 if (stream->writeFlag(mask & (SoundMaskN << i))) 2968 if (stream->writeFlag(st.play)) 2969 stream->writeRangedU32(st.profile->getId(),DataBlockObjectIdFirst, 2970 DataBlockObjectIdLast); 2971 } 2972 } 2973 2974 if (stream->writeFlag(mask & ImageMask)) { 2975 for (S32 i = 0; i < MaxMountedImages; i++) 2976 if (stream->writeFlag(mask & (ImageMaskN << i))) { 2977 MountedImage& image = mMountedImageList[i]; 2978 if (stream->writeFlag(image.dataBlock)) 2979 stream->writeInt(image.dataBlock->getId() - DataBlockObjectIdFirst, 2980 DataBlockObjectIdBitSize); 2981 con->packNetStringHandleU(stream, image.skinNameHandle); 2982 con->packNetStringHandleU(stream, image.scriptAnimPrefix); 2983 2984 // Used to force the 1st person rendering on the client. This is required 2985 // as this object could be ghosted to the client prior to its controlling client 2986 // being set. Therefore there is a network tick when the object is in limbo... 2987 stream->writeFlag(image.dataBlock && image.dataBlock->animateAllShapes && getControllingClient() == con); 2988 2989 stream->writeFlag(image.wet); 2990 stream->writeFlag(image.motion); 2991 stream->writeFlag(image.ammo); 2992 stream->writeFlag(image.loaded); 2993 stream->writeFlag(image.target); 2994 stream->writeFlag(image.triggerDown); 2995 stream->writeFlag(image.altTriggerDown); 2996 2997 for (U32 j=0; j<ShapeBaseImageData::MaxGenericTriggers; ++j) 2998 { 2999 stream->writeFlag(image.genericTrigger[j]); 3000 } 3001 3002 stream->writeInt(image.fireCount,3); 3003 stream->writeInt(image.altFireCount,3); 3004 stream->writeInt(image.reloadCount,3); 3005 stream->writeFlag(isImageFiring(i)); 3006 stream->writeFlag(isImageAltFiring(i)); 3007 stream->writeFlag(isImageReloading(i)); 3008 } 3009 } 3010 3011 // Group some of the uncommon stuff together. 3012 if (stream->writeFlag(mask & (NameMask | CloakMask | SkinMask | MeshHiddenMask ))) { 3013 3014 if (stream->writeFlag(mask & CloakMask)) 3015 { 3016 // cloaking 3017 stream->writeFlag( mCloaked ); 3018 3019 // piggyback control update 3020 stream->writeFlag(bool(getControllingClient())); 3021 3022 // fading 3023 if(stream->writeFlag(mFading && mFadeElapsedTime >= mFadeDelay)) { 3024 stream->writeFlag(mFadeOut); 3025 stream->write(mFadeTime); 3026 } 3027 else 3028 stream->writeFlag(mFadeVal == 1.0f); 3029 } 3030 if (stream->writeFlag(mask & NameMask)) { 3031 con->packNetStringHandleU(stream, mShapeNameHandle); 3032 } 3033 3034 if ( stream->writeFlag( mask & MeshHiddenMask ) ) 3035 stream->writeBits( mMeshHidden ); 3036 3037 if (stream->writeFlag(mask & SkinMask)) 3038 con->packNetStringHandleU(stream, mSkinNameHandle); 3039 } 3040 3041 return retMask; 3042} 3043 3044void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream) 3045{ 3046 Parent::unpackUpdate(con, stream); 3047 mLastRenderFrame = sLastRenderFrame; // make sure we get a process after the event... 3048 3049 if(!stream->readFlag()) 3050 return; 3051 3052 if (stream->readFlag()) { 3053 mDamage = mClampF(stream->readFloat(DamageLevelBits) * mDataBlock->maxDamage, 0.f, mDataBlock->maxDamage); 3054 DamageState prevState = mDamageState; 3055 mDamageState = DamageState(stream->readInt(NumDamageStateBits)); 3056 stream->readNormalVector( &damageDir, 8 ); 3057 if (prevState != Destroyed && mDamageState == Destroyed && isProperlyAdded()) 3058 blowUp(); 3059 updateDamageLevel(); 3060 updateDamageState(); 3061 } 3062 3063 if (stream->readFlag()) { 3064 for (S32 i = 0; i < MaxScriptThreads; i++) { 3065 if (stream->readFlag()) { 3066 Thread& st = mScriptThread[i]; 3067 U32 seq = stream->readInt(ThreadSequenceBits); 3068 st.state = Thread::State(stream->readInt(2)); 3069 stream->read( &st.timescale ); 3070 stream->read( &st.position ); 3071 st.atEnd = stream->readFlag(); 3072 if (st.sequence != seq && st.state != Thread::Destroy) 3073 setThreadSequence(i,seq,false); 3074 else 3075 updateThread(st); 3076 } 3077 } 3078 } 3079 3080 if ( stream->readFlag() ) 3081 { 3082 for ( S32 i = 0; i < MaxSoundThreads; i++ ) 3083 { 3084 if ( stream->readFlag() ) 3085 { 3086 Sound& st = mSoundThread[i]; 3087 st.play = stream->readFlag(); 3088 if ( st.play ) 3089 { 3090 st.profile = (SFXTrack*) stream->readRangedU32( DataBlockObjectIdFirst, 3091 DataBlockObjectIdLast ); 3092 } 3093 3094 if ( isProperlyAdded() ) 3095 updateAudioState( st ); 3096 } 3097 } 3098 } 3099 3100 // Mounted Images 3101 if (stream->readFlag()) { 3102 for (S32 i = 0; i < MaxMountedImages; i++) { 3103 if (stream->readFlag()) { 3104 MountedImage& image = mMountedImageList[i]; 3105 ShapeBaseImageData* imageData = 0; 3106 if (stream->readFlag()) { 3107 SimObjectId id = stream->readInt(DataBlockObjectIdBitSize) + 3108 DataBlockObjectIdFirst; 3109 if (!Sim::findObject(id,imageData)) { 3110 con->setLastError("Invalid packet (mounted images)."); 3111 return; 3112 } 3113 } 3114 3115 NetStringHandle skinDesiredNameHandle = con->unpackNetStringHandleU(stream); 3116 3117 NetStringHandle scriptDesiredAnimPrefix = con->unpackNetStringHandleU(stream); 3118 3119 image.forceAnimateAllShapes = stream->readFlag(); 3120 3121 image.wet = stream->readFlag(); 3122 3123 image.motion = stream->readFlag(); 3124 3125 image.ammo = stream->readFlag(); 3126 3127 image.loaded = stream->readFlag(); 3128 3129 image.target = stream->readFlag(); 3130 3131 image.triggerDown = stream->readFlag(); 3132 image.altTriggerDown = stream->readFlag(); 3133 3134 for (U32 j=0; j<ShapeBaseImageData::MaxGenericTriggers; ++j) 3135 { 3136 image.genericTrigger[j] = stream->readFlag(); 3137 } 3138 3139 S32 count = stream->readInt(3); 3140 S32 altCount = stream->readInt(3); 3141 S32 reloadCount = stream->readInt(3); 3142 3143 bool datablockChange = image.dataBlock != imageData; 3144 if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle)) 3145 { 3146 MountedImage& image = mMountedImageList[i]; 3147 image.scriptAnimPrefix = scriptDesiredAnimPrefix; 3148 3149 setImage( i, imageData, 3150 skinDesiredNameHandle, image.loaded, 3151 image.ammo, image.triggerDown, image.altTriggerDown, 3152 image.motion, image.genericTrigger[0], image.genericTrigger[1], image.genericTrigger[2], image.genericTrigger[3], 3153 image.target); 3154 } 3155 3156 if (!datablockChange && image.scriptAnimPrefix != scriptDesiredAnimPrefix) 3157 { 3158 // We don't have a new image, but we do have a new script anim prefix to work with. 3159 // Notify the image of this change. 3160 MountedImage& image = mMountedImageList[i]; 3161 image.scriptAnimPrefix = scriptDesiredAnimPrefix; 3162 updateAnimThread(i, getImageShapeIndex(image)); 3163 } 3164 3165 bool isFiring = stream->readFlag(); 3166 bool isAltFiring = stream->readFlag(); 3167 bool isReloading = stream->readFlag(); 3168 3169 if (isProperlyAdded()) { 3170 // Normal processing 3171 bool processFiring = false; 3172 if (count != image.fireCount) 3173 { 3174 image.fireCount = count; 3175 setImageState(i,getImageFireState(i),true); 3176 processFiring = true; 3177 } 3178 else if (altCount != image.altFireCount) 3179 { 3180 image.altFireCount = altCount; 3181 setImageState(i,getImageAltFireState(i),true); 3182 processFiring = true; 3183 } 3184 else if (reloadCount != image.reloadCount) 3185 { 3186 image.reloadCount = reloadCount; 3187 setImageState(i,getImageReloadState(i),true); 3188 } 3189 3190 if (processFiring && imageData) 3191 { 3192 if ( imageData->lightType == ShapeBaseImageData::WeaponFireLight ) 3193 image.lightStart = Sim::getCurrentTime(); 3194 } 3195 3196 updateImageState(i,0); 3197 } 3198 else 3199 { 3200 if(imageData) 3201 { 3202 // Initial state 3203 image.fireCount = count; 3204 image.altFireCount = altCount; 3205 image.reloadCount = reloadCount; 3206 if (isFiring) 3207 setImageState(i,getImageFireState(i),true); 3208 else if (isAltFiring) 3209 setImageState(i,getImageAltFireState(i),true); 3210 else if (isReloading) 3211 setImageState(i,getImageReloadState(i),true); 3212 } 3213 } 3214 } 3215 } 3216 } 3217 3218 if (stream->readFlag()) 3219 { 3220 if(stream->readFlag()) // CloakMask and control 3221 { 3222 // Read cloaking state. 3223 3224 setCloakedState(stream->readFlag()); 3225 mIsControlled = stream->readFlag(); 3226 3227 if (( mFading = stream->readFlag()) == true) { 3228 mFadeOut = stream->readFlag(); 3229 if(mFadeOut) 3230 mFadeVal = 1.0f; 3231 else 3232 mFadeVal = 0; 3233 stream->read(&mFadeTime); 3234 mFadeDelay = 0; 3235 mFadeElapsedTime = 0; 3236 } 3237 else 3238 mFadeVal = F32(stream->readFlag()); 3239 } 3240 if (stream->readFlag()) { // NameMask 3241 mShapeNameHandle = con->unpackNetStringHandleU(stream); 3242 } 3243 3244 if ( stream->readFlag() ) // MeshHiddenMask 3245 { 3246 stream->readBits( &mMeshHidden ); 3247 _updateHiddenMeshes(); 3248 } 3249 3250 if (stream->readFlag()) // SkinMask 3251 { 3252 NetStringHandle skinDesiredNameHandle = con->unpackNetStringHandleU(stream);; 3253 if (mSkinNameHandle != skinDesiredNameHandle) 3254 { 3255 mSkinNameHandle = skinDesiredNameHandle; 3256 reSkin(); 3257 } 3258 } 3259 } 3260} 3261 3262 3263//-------------------------------------------------------------------------- 3264 3265void ShapeBase::forceUncloak(const char * reason) 3266{ 3267 AssertFatal(isServerObject(), "ShapeBase::forceUncloak: server only call"); 3268 if(!mCloaked) 3269 return; 3270 3271 mDataBlock->onForceUncloak_callback( this, reason ? reason : "" ); 3272} 3273 3274void ShapeBase::setCloakedState(bool cloaked) 3275{ 3276 if (cloaked == mCloaked) 3277 return; 3278 3279 if (isServerObject()) 3280 setMaskBits(CloakMask); 3281 3282 // Have to do this for the client, if we are ghosted over in the initial 3283 // packet as cloaked, we set the state immediately to the extreme 3284 if (isProperlyAdded() == false) { 3285 mCloaked = cloaked; 3286 if (mCloaked) 3287 mCloakLevel = 1.0; 3288 else 3289 mCloakLevel = 0.0; 3290 } else { 3291 mCloaked = cloaked; 3292 } 3293} 3294 3295 3296//-------------------------------------------------------------------------- 3297 3298void ShapeBase::setHidden( bool hidden ) 3299{ 3300 if( hidden != isHidden() ) 3301 { 3302 Parent::setHidden( hidden ); 3303 3304 if( hidden ) 3305 setProcessTick( false ); 3306 else 3307 setProcessTick( true ); 3308 } 3309} 3310 3311//-------------------------------------------------------------------------- 3312 3313void ShapeBaseConvex::findNodeTransform() 3314{ 3315 S32 dl = pShapeBase->mDataBlock->collisionDetails[hullId]; 3316 3317 TSShapeInstance* si = pShapeBase->getShapeInstance(); 3318 TSShape* shape = si->getShape(); 3319 3320 const TSShape::Detail* detail = &shape->details[dl]; 3321 const S32 subs = detail->subShapeNum; 3322 const S32 start = shape->subShapeFirstObject[subs]; 3323 const S32 end = start + shape->subShapeNumObjects[subs]; 3324 3325 // Find the first object that contains a mesh for this 3326 // detail level. There should only be one mesh per 3327 // collision detail level. 3328 for (S32 i = start; i < end; i++) 3329 { 3330 const TSShape::Object* obj = &shape->objects[i]; 3331 if (obj->numMeshes && detail->objectDetailNum < obj->numMeshes) 3332 { 3333 nodeTransform = &si->mNodeTransforms[obj->nodeIndex]; 3334 return; 3335 } 3336 } 3337 return; 3338} 3339 3340const MatrixF& ShapeBaseConvex::getTransform() const 3341{ 3342 // If the transform isn't specified, it's assumed to be the 3343 // origin of the shape. 3344 const MatrixF& omat = (transform != 0)? *transform: mObject->getTransform(); 3345 3346 // Multiply on the mesh shape offset 3347 // tg: Returning this static here is not really a good idea, but 3348 // all this Convex code needs to be re-organized. 3349 if (nodeTransform) { 3350 static MatrixF mat; 3351 mat.mul(omat,*nodeTransform); 3352 return mat; 3353 } 3354 return omat; 3355} 3356 3357Box3F ShapeBaseConvex::getBoundingBox() const 3358{ 3359 const MatrixF& omat = (transform != 0)? *transform: mObject->getTransform(); 3360 return getBoundingBox(omat, mObject->getScale()); 3361} 3362 3363Box3F ShapeBaseConvex::getBoundingBox(const MatrixF& mat, const Point3F& scale) const 3364{ 3365 Box3F newBox = box; 3366 newBox.minExtents.convolve(scale); 3367 newBox.maxExtents.convolve(scale); 3368 mat.mul(newBox); 3369 return newBox; 3370} 3371 3372Point3F ShapeBaseConvex::support(const VectorF& v) const 3373{ 3374 TSShape::ConvexHullAccelerator* pAccel = 3375 pShapeBase->mShapeInstance->getShape()->getAccelerator(pShapeBase->mDataBlock->collisionDetails[hullId]); 3376 AssertFatal(pAccel != NULL, "Error, no accel!"); 3377 3378 F32 currMaxDP = mDot(pAccel->vertexList[0], v); 3379 U32 index = 0; 3380 for (U32 i = 1; i < pAccel->numVerts; i++) { 3381 F32 dp = mDot(pAccel->vertexList[i], v); 3382 if (dp > currMaxDP) { 3383 currMaxDP = dp; 3384 index = i; 3385 } 3386 } 3387 3388 return pAccel->vertexList[index]; 3389} 3390 3391 3392void ShapeBaseConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf) 3393{ 3394 cf->material = 0; 3395 cf->object = mObject; 3396 3397 TSShape::ConvexHullAccelerator* pAccel = 3398 pShapeBase->mShapeInstance->getShape()->getAccelerator(pShapeBase->mDataBlock->collisionDetails[hullId]); 3399 AssertFatal(pAccel != NULL, "Error, no accel!"); 3400 3401 F32 currMaxDP = mDot(pAccel->vertexList[0], n); 3402 U32 index = 0; 3403 U32 i; 3404 for (i = 1; i < pAccel->numVerts; i++) { 3405 F32 dp = mDot(pAccel->vertexList[i], n); 3406 if (dp > currMaxDP) { 3407 currMaxDP = dp; 3408 index = i; 3409 } 3410 } 3411 3412 const U8* emitString = pAccel->emitStrings[index]; 3413 U32 currPos = 0; 3414 U32 numVerts = emitString[currPos++]; 3415 for (i = 0; i < numVerts; i++) { 3416 cf->mVertexList.increment(); 3417 U32 index = emitString[currPos++]; 3418 mat.mulP(pAccel->vertexList[index], &cf->mVertexList.last()); 3419 } 3420 3421 U32 numEdges = emitString[currPos++]; 3422 for (i = 0; i < numEdges; i++) { 3423 U32 ev0 = emitString[currPos++]; 3424 U32 ev1 = emitString[currPos++]; 3425 cf->mEdgeList.increment(); 3426 cf->mEdgeList.last().vertex[0] = ev0; 3427 cf->mEdgeList.last().vertex[1] = ev1; 3428 } 3429 3430 U32 numFaces = emitString[currPos++]; 3431 for (i = 0; i < numFaces; i++) { 3432 cf->mFaceList.increment(); 3433 U32 plane = emitString[currPos++]; 3434 mat.mulV(pAccel->normalList[plane], &cf->mFaceList.last().normal); 3435 for (U32 j = 0; j < 3; j++) 3436 cf->mFaceList.last().vertex[j] = emitString[currPos++]; 3437 } 3438} 3439 3440 3441void ShapeBaseConvex::getPolyList(AbstractPolyList* list) 3442{ 3443 list->setTransform(&pShapeBase->getTransform(), pShapeBase->getScale()); 3444 list->setObject(pShapeBase); 3445 3446 pShapeBase->mShapeInstance->animate(pShapeBase->mDataBlock->collisionDetails[hullId]); 3447 pShapeBase->mShapeInstance->buildPolyList(list,pShapeBase->mDataBlock->collisionDetails[hullId]); 3448} 3449 3450 3451//-------------------------------------------------------------------------- 3452 3453bool ShapeBase::isInvincible() 3454{ 3455 if( mDataBlock ) 3456 { 3457 return mDataBlock->isInvincible; 3458 } 3459 return false; 3460} 3461 3462void ShapeBase::startFade( F32 fadeTime, F32 fadeDelay, bool fadeOut ) 3463{ 3464 setMaskBits(CloakMask); 3465 mFadeElapsedTime = 0; 3466 mFading = true; 3467 if(fadeDelay < 0) 3468 fadeDelay = 0; 3469 if(fadeTime < 0) 3470 fadeTime = 0; 3471 mFadeTime = fadeTime; 3472 mFadeDelay = fadeDelay; 3473 mFadeOut = fadeOut; 3474 mFadeVal = F32(mFadeOut); 3475} 3476 3477//-------------------------------------------------------------------------- 3478 3479void ShapeBase::setShapeName(const char* name) 3480{ 3481 if (!isGhost()) { 3482 if (name[0] != '\0') { 3483 // Use tags for better network performance 3484 // Should be a tag, but we'll convert to one if it isn't. 3485 if (name[0] == StringTagPrefixByte) 3486 mShapeNameHandle = NetStringHandle(U32(dAtoi(name + 1))); 3487 else 3488 mShapeNameHandle = NetStringHandle(name); 3489 } 3490 else { 3491 mShapeNameHandle = NetStringHandle(); 3492 } 3493 setMaskBits(NameMask); 3494 } 3495} 3496 3497void ShapeBase::setSkinName(const char* name) 3498{ 3499 if (!isGhost()) { 3500 if (name[0] != '\0') { 3501 // Use tags for better network performance 3502 // Should be a tag, but we'll convert to one if it isn't. 3503 if (name[0] == StringTagPrefixByte) 3504 mSkinNameHandle = NetStringHandle(U32(dAtoi(name + 1))); 3505 else 3506 mSkinNameHandle = NetStringHandle(name); 3507 } 3508 else 3509 mSkinNameHandle = NetStringHandle(); 3510 setMaskBits(SkinMask); 3511 } 3512} 3513 3514//---------------------------------------------------------------------------- 3515 3516void ShapeBase::reSkin() 3517{ 3518 if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() ) 3519 { 3520 Vector<String> skins; 3521 String(mSkinNameHandle.getString()).split( ";", skins ); 3522 3523 for (S32 i = 0; i < skins.size(); i++) 3524 { 3525 String oldSkin( mAppliedSkinName.c_str() ); 3526 String newSkin( skins[i] ); 3527 3528 // Check if the skin handle contains an explicit "old" base string. This 3529 // allows all models to support skinning, even if they don't follow the 3530 // "base_xxx" material naming convention. 3531 S32 split = newSkin.find( '=' ); // "old=new" format skin? 3532 if ( split != String::NPos ) 3533 { 3534 oldSkin = newSkin.substr( 0, split ); 3535 newSkin = newSkin.erase( 0, split+1 ); 3536 } 3537 3538 mShapeInstance->reSkin( newSkin, oldSkin ); 3539 mAppliedSkinName = newSkin; 3540 } 3541 } 3542} 3543 3544void ShapeBase::setCurrentWaterObject( WaterObject *obj ) 3545{ 3546 if ( obj ) 3547 deleteNotify( obj ); 3548 if ( mCurrentWaterObject ) 3549 clearNotify( mCurrentWaterObject ); 3550 3551 mCurrentWaterObject = obj; 3552} 3553 3554//-------------------------------------------------------------------------- 3555//---------------------------------------------------------------------------- 3556DefineEngineMethod( ShapeBase, setHidden, void, ( bool show ),, 3557 "@brief Add or remove this object from the scene.\n\n" 3558 "When removed from the scene, the object will not be processed or rendered.\n" 3559 "@param show False to hide the object, true to re-show it\n\n" ) 3560{ 3561 object->setHidden( show ); 3562} 3563 3564DefineEngineMethod( ShapeBase, isHidden, bool, (),, 3565 "Check if the object is hidden.\n" 3566 "@return true if the object is hidden, false if visible.\n\n" ) 3567{ 3568 return object->isHidden(); 3569} 3570 3571//---------------------------------------------------------------------------- 3572DefineEngineMethod( ShapeBase, playAudio, bool, ( S32 slot, SFXTrack* track ),, 3573 "@brief Attach a sound to this shape and start playing it.\n\n" 3574 3575 "@param slot Audio slot index for the sound (valid range is 0 - 3)\n" // 3 = ShapeBase::MaxSoundThreads-1 3576 "@param track SFXTrack to play\n" 3577 "@return true if the sound was attached successfully, false if failed\n\n" 3578 3579 "@see stopAudio()\n") 3580{ 3581 if (track && slot >= 0 && slot < ShapeBase::MaxSoundThreads) { 3582 object->playAudio(slot,track); 3583 return true; 3584 } 3585 return false; 3586} 3587 3588DefineEngineMethod( ShapeBase, stopAudio, bool, ( S32 slot ),, 3589 "@brief Stop a sound started with playAudio.\n\n" 3590 3591 "@param slot audio slot index (started with playAudio)\n" 3592 "@return true if the sound was stopped successfully, false if failed\n\n" 3593 3594 "@see playAudio()\n") 3595{ 3596 if (slot >= 0 && slot < ShapeBase::MaxSoundThreads) { 3597 object->stopAudio(slot); 3598 return true; 3599 } 3600 return false; 3601} 3602 3603 3604//---------------------------------------------------------------------------- 3605DefineEngineMethod( ShapeBase, playThread, bool, ( S32 slot, const char* name ), ( "" ), 3606 "@brief Start a new animation thread, or restart one that has been paused or " 3607 "stopped.\n\n" 3608 3609 "@param slot thread slot to play. Valid range is 0 - 3)\n" // 3 = ShapeBase::MaxScriptThreads-1 3610 "@param name name of the animation sequence to play in this slot. If not " 3611 "specified, the paused or stopped thread in this slot will be resumed.\n" 3612 "@return true if successful, false if failed\n\n" 3613 3614 "@tsexample\n" 3615 "%obj.playThread( 0, \"ambient\" ); // Play the ambient sequence in slot 0\n" 3616 "%obj.setThreadTimeScale( 0, 0.5 ); // Play at half-speed\n" 3617 "%obj.pauseThread( 0 ); // Pause the sequence\n" 3618 "%obj.playThread( 0 ); // Resume playback\n" 3619 "%obj.playThread( 0, \"spin\" ); // Replace the sequence in slot 0\n" 3620 "@endtsexample\n" 3621 3622 "@see pauseThread()\n" 3623 "@see stopThread()\n" 3624 "@see setThreadDir()\n" 3625 "@see setThreadTimeScale()\n" 3626 "@see destroyThread()\n") 3627{ 3628 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3629 if (!dStrEqual(name, "")) { 3630 if (object->getShape()) { 3631 S32 seq = object->getShape()->findSequence(name); 3632 if (seq != -1 && object->setThreadSequence(slot,seq)) 3633 return true; 3634 } 3635 } 3636 else 3637 if (object->playThread(slot)) 3638 return true; 3639 } 3640 return false; 3641} 3642 3643DefineEngineMethod( ShapeBase, setThreadDir, bool, ( S32 slot, bool fwd ),, 3644 "@brief Set the playback direction of an animation thread.\n\n" 3645 3646 "@param slot thread slot to modify\n" 3647 "@param fwd true to play the animation forwards, false to play backwards\n" 3648 "@return true if successful, false if failed\n\n" 3649 3650 "@see playThread()\n" ) 3651{ 3652 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3653 if (object->setThreadDir(slot,fwd)) 3654 return true; 3655 } 3656 return false; 3657} 3658 3659DefineEngineMethod( ShapeBase, setThreadTimeScale, bool, ( S32 slot, F32 scale ),, 3660 "@brief Set the playback time scale of an animation thread.\n\n" 3661 3662 "@param slot thread slot to modify\n" 3663 "@param scale new thread time scale (1=normal speed, 0.5=half speed etc)\n" 3664 "@return true if successful, false if failed\n\n" 3665 3666 "@see playThread\n" ) 3667{ 3668 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3669 if (object->setThreadTimeScale(slot,scale)) 3670 return true; 3671 } 3672 return false; 3673} 3674 3675DefineEngineMethod( ShapeBase, setThreadPosition, bool, ( S32 slot, F32 pos ),, 3676 "@brief Set the position within an animation thread.\n\n" 3677 3678 "@param slot thread slot to modify\n" 3679 "@param pos position within thread\n" 3680 "@return true if successful, false if failed\n\n" 3681 3682 "@see playThread\n" ) 3683{ 3684 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3685 if (object->setThreadPosition(slot,pos)) 3686 return true; 3687 } 3688 return false; 3689} 3690 3691DefineEngineMethod( ShapeBase, stopThread, bool, ( S32 slot ),, 3692 "@brief Stop an animation thread.\n\n" 3693 3694 "If restarted using playThread, the animation " 3695 "will start from the beginning again.\n" 3696 "@param slot thread slot to stop\n" 3697 "@return true if successful, false if failed\n\n" 3698 3699 "@see playThread\n" ) 3700{ 3701 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3702 if (object->stopThread(slot)) 3703 return true; 3704 } 3705 return false; 3706} 3707 3708DefineEngineMethod( ShapeBase, destroyThread, bool, ( S32 slot ),, 3709 "@brief Destroy an animation thread, which prevents it from playing.\n\n" 3710 3711 "@param slot thread slot to destroy\n" 3712 "@return true if successful, false if failed\n\n" 3713 3714 "@see playThread\n" ) 3715{ 3716 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3717 if (object->destroyThread(slot)) 3718 return true; 3719 } 3720 return false; 3721} 3722 3723DefineEngineMethod( ShapeBase, pauseThread, bool, ( S32 slot ),, 3724 "@brief Pause an animation thread.\n\n" 3725 3726 "If restarted using playThread, the animation " 3727 "will resume from the paused position.\n" 3728 "@param slot thread slot to stop\n" 3729 "@return true if successful, false if failed\n\n" 3730 3731 "@see playThread\n" ) 3732{ 3733 if (slot >= 0 && slot < ShapeBase::MaxScriptThreads) { 3734 if (object->pauseThread(slot)) 3735 return true; 3736 } 3737 return false; 3738} 3739 3740//---------------------------------------------------------------------------- 3741DefineEngineMethod( ShapeBase, mountImage, bool, 3742 ( ShapeBaseImageData* image, S32 slot, bool loaded, const char* skinTag ), ( true, "" ), 3743 "@brief Mount a new Image.\n\n" 3744 3745 "@param image the Image to mount\n" 3746 "@param slot Image slot to mount into (valid range is 0 - 3)\n" 3747 "@param loaded initial loaded state for the Image\n" 3748 "@param skinTag tagged string to reskin the mounted Image\n" 3749 "@return true if successful, false if failed\n\n" 3750 3751 "@tsexample\n" 3752 "%player.mountImage( PistolImage, 1 );\n" 3753 "%player.mountImage( CrossbowImage, 0, false );\n" 3754 "%player.mountImage( RocketLauncherImage, 0, true, 'blue' );\n" 3755 "@endtsexample\n" 3756 3757 "@see unmountImage()\n" 3758 "@see getMountedImage()\n" 3759 "@see getPendingImage()\n" 3760 "@see isImageMounted()\n") 3761{ 3762 if (image && slot >= 0 && slot < ShapeBase::MaxMountedImages) { 3763 3764 NetStringHandle team; 3765 if (skinTag[0] == StringTagPrefixByte) 3766 team = NetStringHandle(U32(dAtoi(skinTag+1))); 3767 3768 return object->mountImage( image, slot, loaded, team ); 3769 } 3770 return false; 3771} 3772 3773DefineEngineMethod( ShapeBase, unmountImage, bool, ( S32 slot ),, 3774 "@brief Unmount the mounted Image in the specified slot.\n\n" 3775 3776 "@param slot Image slot to unmount\n" 3777 "@return true if successful, false if failed\n\n" 3778 3779 "@see mountImage()\n") 3780{ 3781 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3782 return object->unmountImage(slot); 3783 return false; 3784} 3785 3786DefineEngineMethod( ShapeBase, getMountedImage, S32, ( S32 slot ),, 3787 "@brief Get the Image mounted in the specified slot.\n\n" 3788 3789 "@param slot Image slot to query\n" 3790 "@return ID of the ShapeBaseImageData datablock mounted in the slot, or 0 " 3791 "if no Image is mounted there.\n\n" ) 3792{ 3793 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3794 if (ShapeBaseImageData* data = object->getMountedImage(slot)) 3795 return data->getId(); 3796 return 0; 3797} 3798 3799DefineEngineMethod( ShapeBase, getPendingImage, S32, ( S32 slot ),, 3800 "@brief Get the Image that will be mounted next in the specified slot.\n\n" 3801 3802 "Calling mountImage when an Image is already mounted does one of two things: " 3803 "<ol><li>Mount the new Image immediately, the old Image is discarded and " 3804 "whatever state it was in is ignored.</li>" 3805 "<li>If the current Image state does not allow Image changes, the new " 3806 "Image is marked as pending, and will not be mounted until the current " 3807 "state completes. eg. if the user changes weapons, you may wish to ensure " 3808 "that the current weapon firing state plays to completion first.</li></ol>\n" 3809 "This command retrieves the ID of the pending Image (2nd case above).\n" 3810 3811 "@param slot Image slot to query\n" 3812 "@return ID of the pending ShapeBaseImageData datablock, or 0 if none.\n\n" ) 3813{ 3814 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3815 if (ShapeBaseImageData* data = object->getPendingImage(slot)) 3816 return data->getId(); 3817 return 0; 3818} 3819 3820DefineEngineMethod( ShapeBase, isImageFiring, bool, ( S32 slot ),, 3821 "@brief Check if the current Image state is firing.\n\n" 3822 3823 "@param slot Image slot to query\n" 3824 "@return true if the current Image state in this slot has the 'stateFire' flag set.\n" ) 3825{ 3826 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3827 return object->isImageFiring(slot); 3828 return false; 3829} 3830 3831DefineEngineMethod( ShapeBase, isImageMounted, bool, ( ShapeBaseImageData* image ),, 3832 "@brief Check if the given datablock is mounted to any slot on this object.\n\n" 3833 3834 "@param image ShapeBaseImageData datablock to query\n" 3835 "@return true if the Image is mounted to any slot, false otherwise.\n\n" ) 3836{ 3837 return (image && object->isImageMounted(image)); 3838} 3839 3840DefineEngineMethod( ShapeBase, getMountSlot, S32, ( ShapeBaseImageData* image ),, 3841 "@brief Get the first slot the given datablock is mounted to on this object.\n\n" 3842 3843 "@param image ShapeBaseImageData datablock to query\n" 3844 "@return index of the first slot the Image is mounted in, or -1 if the Image " 3845 "is not mounted in any slot on this object.\n\n" ) 3846 3847{ 3848 return image ? object->getMountSlot(image) : -1; 3849} 3850 3851DefineEngineMethod( ShapeBase, getImageSkinTag, S32, ( S32 slot ),, 3852 "@brief Get the skin tag ID for the Image mounted in the specified slot.\n\n" 3853 3854 "@param slot Image slot to query\n" 3855 "@return the skinTag value passed to mountImage when the image was " 3856 "mounted\n\n" ) 3857{ 3858 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3859 return object->getImageSkinTag(slot).getIndex(); 3860 return -1; 3861} 3862 3863DefineEngineMethod( ShapeBase, getImageState, const char*, ( S32 slot ),, 3864 "@brief Get the name of the current state of the Image in the specified slot.\n\n" 3865 3866 "@param slot Image slot to query\n" 3867 "@return name of the current Image state, or \"Error\" if slot is invalid\n\n" ) 3868{ 3869 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3870 return object->getImageState(slot); 3871 return "Error"; 3872} 3873 3874DefineEngineMethod( ShapeBase, hasImageState, bool, ( S32 slot, const char* state ),, 3875 "@brief Check if the given state exists on the mounted Image.\n\n" 3876 3877 "@param slot Image slot to query\n" 3878 "@param state Image state to check for\n" 3879 "@return true if the Image has the requested state defined.\n\n" ) 3880{ 3881 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3882 return object->hasImageState(slot, state); 3883 return false; 3884} 3885 3886DefineEngineMethod( ShapeBase, getImageTrigger, bool, ( S32 slot ),, 3887 "@brief Get the trigger state of the Image mounted in the specified slot.\n\n" 3888 3889 "@param slot Image slot to query\n" 3890 "@return the Image's current trigger state\n\n" ) 3891{ 3892 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3893 return object->getImageTriggerState(slot); 3894 return false; 3895} 3896 3897DefineEngineMethod( ShapeBase, setImageTrigger, bool, ( S32 slot, bool state ),, 3898 "@brief Set the trigger state of the Image mounted in the specified slot.\n\n" 3899 3900 "@param slot Image slot to modify\n" 3901 "@param state new trigger state for the Image\n" 3902 "@return the Image's new trigger state\n\n" ) 3903{ 3904 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 3905 object->setImageTriggerState(slot,state); 3906 return object->getImageTriggerState(slot); 3907 } 3908 return false; 3909} 3910 3911DefineEngineMethod( ShapeBase, getImageGenericTrigger, bool, ( S32 slot, S32 trigger ),, 3912 "@brief Get the generic trigger state of the Image mounted in the specified slot.\n\n" 3913 3914 "@param slot Image slot to query\n" 3915 "@param trigger Generic trigger number\n" 3916 "@return the Image's current generic trigger state\n\n" ) 3917{ 3918 if (slot >= 0 && slot < ShapeBase::MaxMountedImages && trigger >= 0 && trigger < ShapeBaseImageData::MaxGenericTriggers) 3919 return object->getImageGenericTriggerState(slot, trigger); 3920 return false; 3921} 3922 3923DefineEngineMethod( ShapeBase, setImageGenericTrigger, S32, ( S32 slot, S32 trigger, bool state ),, 3924 "@brief Set the generic trigger state of the Image mounted in the specified slot.\n\n" 3925 3926 "@param slot Image slot to modify\n" 3927 "@param trigger Generic trigger number\n" 3928 "@param state new generic trigger state for the Image\n" 3929 "@return the Image's new generic trigger state or -1 if there was a problem.\n\n" ) 3930{ 3931 if (slot >= 0 && slot < ShapeBase::MaxMountedImages && trigger >= 0 && trigger < ShapeBaseImageData::MaxGenericTriggers) { 3932 object->setImageGenericTriggerState(slot,trigger,state); 3933 return object->getImageGenericTriggerState(slot,trigger); 3934 } 3935 return -1; 3936} 3937 3938DefineEngineMethod( ShapeBase, getImageAltTrigger, bool, ( S32 slot ),, 3939 "@brief Get the alt trigger state of the Image mounted in the specified slot.\n\n" 3940 3941 "@param slot Image slot to query\n" 3942 "@return the Image's current alt trigger state\n\n" ) 3943{ 3944 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3945 return object->getImageAltTriggerState(slot); 3946 return false; 3947} 3948 3949DefineEngineMethod( ShapeBase, setImageAltTrigger, bool, ( S32 slot, bool state ),, 3950 "@brief Set the alt trigger state of the Image mounted in the specified slot.\n\n" 3951 3952 "@param slot Image slot to modify\n" 3953 "@param state new alt trigger state for the Image\n" 3954 "@return the Image's new alt trigger state\n\n" ) 3955{ 3956 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 3957 object->setImageAltTriggerState(slot,state); 3958 return object->getImageAltTriggerState(slot); 3959 } 3960 return false; 3961} 3962 3963DefineEngineMethod( ShapeBase, getImageAmmo, bool, ( S32 slot ),, 3964 "@brief Get the ammo state of the Image mounted in the specified slot.\n\n" 3965 3966 "@param slot Image slot to query\n" 3967 "@return the Image's current ammo state\n\n" ) 3968{ 3969 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3970 return object->getImageAmmoState(slot); 3971 return false; 3972} 3973 3974DefineEngineMethod( ShapeBase, setImageAmmo, bool, ( S32 slot, bool state ),, 3975 "@brief Set the ammo state of the Image mounted in the specified slot.\n\n" 3976 3977 "@param slot Image slot to modify\n" 3978 "@param state new ammo state for the Image\n" 3979 "@return the Image's new ammo state\n\n" ) 3980{ 3981 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 3982 object->setImageAmmoState(slot,state); 3983 return state; 3984 } 3985 return false; 3986} 3987 3988DefineEngineMethod( ShapeBase, getImageLoaded, bool, ( S32 slot ),, 3989 "@brief Get the loaded state of the Image mounted in the specified slot.\n\n" 3990 3991 "@param slot Image slot to query\n" 3992 "@return the Image's current loaded state\n\n" ) 3993{ 3994 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 3995 return object->getImageLoadedState(slot); 3996 return false; 3997} 3998 3999DefineEngineMethod( ShapeBase, setImageLoaded, bool, ( S32 slot, bool state ),, 4000 "@brief Set the loaded state of the Image mounted in the specified slot.\n\n" 4001 4002 "@param slot Image slot to modify\n" 4003 "@param state new loaded state for the Image\n" 4004 "@return the Image's new loaded state\n\n" ) 4005{ 4006 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 4007 object->setImageLoadedState(slot, state); 4008 return state; 4009 } 4010 return false; 4011} 4012 4013DefineEngineMethod( ShapeBase, getImageTarget, bool, ( S32 slot ),, 4014 "@brief Get the target state of the Image mounted in the specified slot.\n\n" 4015 4016 "@param slot Image slot to query\n" 4017 "@return the Image's current target state\n\n" ) 4018{ 4019 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 4020 return object->getImageTargetState(slot); 4021 return false; 4022} 4023 4024DefineEngineMethod( ShapeBase, setImageTarget, bool, ( S32 slot, bool state ),, 4025 "@brief Set the target state of the Image mounted in the specified slot.\n\n" 4026 4027 "@param slot Image slot to modify\n" 4028 "@param state new target state for the Image\n" 4029 "@return the Image's new target state\n\n" ) 4030{ 4031 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 4032 object->setImageTargetState(slot,state); 4033 return state; 4034 } 4035 return false; 4036} 4037 4038DefineEngineMethod( ShapeBase, getImageScriptAnimPrefix, const char*, ( S32 slot ),, 4039 "@brief Get the script animation prefix of the Image mounted in the specified slot.\n\n" 4040 4041 "@param slot Image slot to query\n" 4042 "@return the Image's current script animation prefix\n\n" ) 4043{ 4044 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 4045 return object->getImageScriptAnimPrefix(slot).getString(); 4046 return ""; 4047} 4048 4049DefineEngineMethod( ShapeBase, setImageScriptAnimPrefix, void, ( S32 slot, const char* prefix ),, 4050 "@brief Set the script animation prefix for the Image mounted in the specified slot.\n\n" 4051 "This is used to further modify the prefix used when deciding which animation sequence to " 4052 "play while this image is mounted.\n" 4053 4054 "@param slot Image slot to modify\n" 4055 "@param prefix The prefix applied to the image\n" ) 4056{ 4057 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) { 4058 4059 NetStringHandle prefixHandle; 4060 if (prefix[0] == StringTagPrefixByte) 4061 prefixHandle = NetStringHandle(U32(dAtoi(prefix+1))); 4062 4063 object->setImageScriptAnimPrefix(slot, prefixHandle); 4064 } 4065} 4066 4067DefineEngineMethod( ShapeBase, getMuzzleVector, VectorF, ( S32 slot ),, 4068 "@brief Get the muzzle vector of the Image mounted in the specified slot.\n\n" 4069 4070 "If the Image shape contains a node called 'muzzlePoint', then the muzzle " 4071 "vector is the forward direction vector of that node's transform in world " 4072 "space. If no such node is specified, the slot's mount node is used " 4073 "instead.\n\n" 4074 4075 "If the correctMuzzleVector flag (correctMuzzleVectorTP in 3rd person) " 4076 "is set in the Image, the muzzle vector is computed to point at whatever " 4077 "object is right in front of the object's 'eye' node.\n" 4078 4079 "@param slot Image slot to query\n" 4080 "@return the muzzle vector, or \"0 1 0\" if the slot is invalid\n\n" ) 4081{ 4082 VectorF vec(0, 1, 0); 4083 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 4084 object->getMuzzleVector(slot, &vec); 4085 4086 return vec; 4087} 4088 4089DefineEngineMethod( ShapeBase, getMuzzlePoint, Point3F, ( S32 slot ),, 4090 "@brief Get the muzzle position of the Image mounted in the specified slot.\n\n" 4091 4092 "If the Image shape contains a node called 'muzzlePoint', then the muzzle " 4093 "position is the position of that node in world space. If no such node " 4094 "is specified, the slot's mount node is used instead.\n" 4095 4096 "@param slot Image slot to query\n" 4097 "@return the muzzle position, or \"0 0 0\" if the slot is invalid\n\n" ) 4098{ 4099 Point3F pos(0, 0, 0); 4100 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 4101 object->getMuzzlePoint(slot, &pos); 4102 4103 return pos; 4104} 4105 4106DefineEngineMethod( ShapeBase, getSlotTransform, TransformF, ( S32 slot ),, 4107 "@brief Get the world transform of the specified mount slot.\n\n" 4108 4109 "@param slot Image slot to query\n" 4110 "@return the mount transform\n\n" ) 4111{ 4112 MatrixF xf(true); 4113 if (slot >= 0 && slot < ShapeBase::MaxMountedImages) 4114 object->getMountTransform( slot, MatrixF::Identity, &xf ); 4115 4116 return xf; 4117} 4118 4119//---------------------------------------------------------------------------- 4120 4121DefineEngineMethod( ShapeBase, getAIRepairPoint, Point3F, (),, 4122 "@brief Get the position at which the AI should stand to repair things.\n\n" 4123 4124 "If the shape defines a node called \"AIRepairNode\", this method will " 4125 "return the current world position of that node, otherwise \"0 0 0\".\n" 4126 "@return the AI repair position\n\n" ) 4127{ 4128 return object->getAIRepairPoint(); 4129} 4130 4131DefineEngineMethod( ShapeBase, getVelocity, VectorF, (),, 4132 "@brief Get the object's current velocity.\n\n" 4133 4134 "@return the current velocity\n\n" ) 4135{ 4136 return object->getVelocity(); 4137} 4138 4139DefineEngineMethod( ShapeBase, setVelocity, bool, ( Point3F vel ),, 4140 "@brief Set the object's velocity.\n\n" 4141 4142 "@param vel new velocity for the object\n" 4143 "@return true\n\n" ) 4144{ 4145 object->setVelocity( vel ); 4146 return true; 4147} 4148 4149DefineEngineMethod( ShapeBase, applyImpulse, bool, ( Point3F pos, Point3F vec ),, 4150 "@brief Apply an impulse to the object.\n\n" 4151 4152 "@param pos world position of the impulse\n" 4153 "@param vec impulse momentum (velocity * mass)\n" 4154 "@return true\n\n" ) 4155{ 4156 object->applyImpulse( pos, vec ); 4157 return true; 4158} 4159 4160DefineEngineMethod( ShapeBase, getEyeVector, VectorF, (),, 4161 "@brief Get the forward direction of the 'eye' for this object.\n\n" 4162 4163 "If the object model has a node called 'eye', this method will return that " 4164 "node's current forward direction vector, otherwise it will return the " 4165 "object's current forward direction vector.\n" 4166 4167 "@return the eye vector for this object\n" 4168 4169 "@see getEyePoint\n" 4170 "@see getEyeTransform\n" ) 4171{ 4172 MatrixF mat; 4173 object->getEyeTransform(&mat); 4174 return mat.getForwardVector(); 4175} 4176 4177DefineEngineMethod( ShapeBase, getEyePoint, Point3F, (),, 4178 "@brief Get the position of the 'eye' for this object.\n\n" 4179 4180 "If the object model has a node called 'eye', this method will return that " 4181 "node's current world position, otherwise it will return the object's current " 4182 "world position.\n" 4183 4184 "@return the eye position for this object\n" 4185 4186 "@see getEyeVector\n" 4187 "@see getEyeTransform\n" ) 4188{ 4189 MatrixF mat; 4190 object->getEyeTransform(&mat); 4191 return mat.getPosition(); 4192} 4193 4194DefineEngineMethod( ShapeBase, getEyeTransform, TransformF, (),, 4195 "@brief Get the 'eye' transform for this object.\n\n" 4196 4197 "If the object model has a node called 'eye', this method will return that " 4198 "node's current transform, otherwise it will return the object's current " 4199 "transform.\n" 4200 4201 "@return the eye transform for this object\n" 4202 4203 "@see getEyeVector\n" 4204 "@see getEyePoint\n" ) 4205{ 4206 MatrixF mat; 4207 object->getEyeTransform(&mat); 4208 return mat; 4209} 4210 4211DefineEngineMethod( ShapeBase, getLookAtPoint, const char*, ( F32 distance, S32 typeMask ), ( 2000, 0xFFFFFFFF ), 4212 "@brief Get the world position this object is looking at.\n\n" 4213 4214 "Casts a ray from the eye and returns information about what the ray hits.\n" 4215 4216 "@param distance maximum distance of the raycast\n" 4217 "@param typeMask typeMask of objects to include for raycast collision testing\n" 4218 "@return look-at information as \"Object HitX HitY HitZ [Material]\" or empty string for no hit\n\n" 4219 4220 "@tsexample\n" 4221 "%lookat = %obj.getLookAtPoint();\n" 4222 "echo( \"Looking at: \" @ getWords( %lookat, 1, 3 ) );\n" 4223 "@endtsexample\n" ) 4224{ 4225 MatrixF mat; 4226 object->getEyeTransform( &mat ); 4227 4228 // Get eye vector. 4229 4230 VectorF eyeVector; 4231 mat.getColumn( 1, &eyeVector ); 4232 4233 // Get eye position. 4234 4235 VectorF eyePos; 4236 mat.getColumn( 3, &eyePos ); 4237 4238 // Make sure the eye vector covers the distance. 4239 4240 eyeVector *= distance; 4241 4242 // Do a container search. 4243 4244 VectorF start = eyePos; 4245 VectorF end = eyePos + eyeVector; 4246 4247 RayInfo ri; 4248 if( !gServerContainer.castRay( start, end, typeMask, &ri ) || !ri.object ) 4249 return ""; // No hit. 4250 4251 // Gather hit info. 4252 4253 enum { BUFFER_SIZE = 256 }; 4254 char* buffer = Con::getReturnBuffer( BUFFER_SIZE ); 4255 if( ri.material ) 4256 dSprintf( buffer, BUFFER_SIZE, "%u %f %f %f %u", 4257 ri.object->getId(), 4258 ri.point.x, 4259 ri.point.y, 4260 ri.point.z, 4261 ri.material->getMaterial()->getId() ); 4262 else 4263 dSprintf( buffer, BUFFER_SIZE, "%u %f %f %f", 4264 ri.object->getId(), 4265 ri.point.x, 4266 ri.point.y, 4267 ri.point.z ); 4268 4269 return buffer; 4270} 4271 4272DefineEngineMethod( ShapeBase, setEnergyLevel, void, ( F32 level ),, 4273 "@brief Set this object's current energy level.\n\n" 4274 4275 "@param level new energy level\n" 4276 4277 "@see getEnergyLevel()\n" 4278 "@see getEnergyPercent()\n") 4279{ 4280 object->setEnergyLevel( level ); 4281} 4282 4283DefineEngineMethod( ShapeBase, getEnergyLevel, F32, (),, 4284 "@brief Get the object's current energy level.\n\n" 4285 4286 "@return energy level\n" 4287 4288 "@see setEnergyLevel()\n") 4289{ 4290 return object->getEnergyLevel(); 4291} 4292 4293DefineEngineMethod( ShapeBase, getEnergyPercent, F32, (),, 4294 "@brief Get the object's current energy level as a percentage of maxEnergy.\n\n" 4295 "@return energyLevel / datablock.maxEnergy\n" 4296 4297 "@see setEnergyLevel()\n") 4298{ 4299 return object->getEnergyValue(); 4300} 4301 4302DefineEngineMethod( ShapeBase, setDamageLevel, void, ( F32 level ),, 4303 "@brief Set the object's current damage level.\n\n" 4304 4305 "@param level new damage level\n" 4306 4307 "@see getDamageLevel()\n" 4308 "@see getDamagePercent()\n") 4309{ 4310 object->setDamageLevel( level ); 4311} 4312 4313DefineEngineMethod( ShapeBase, getDamageLevel, F32, (),, 4314 "@brief Get the object's current damage level.\n\n" 4315 4316 "@return damage level\n" 4317 4318 "@see setDamageLevel()\n") 4319{ 4320 return object->getDamageLevel(); 4321} 4322 4323DefineEngineMethod( ShapeBase, getDamagePercent, F32, (),, 4324 "@brief Get the object's current damage level as a percentage of maxDamage.\n\n" 4325 4326 "@return damageLevel / datablock.maxDamage\n" 4327 4328 "@see setDamageLevel()\n") 4329{ 4330 return object->getDamageValue(); 4331} 4332 4333DefineEngineMethod(ShapeBase, getMaxDamage, F32, (),, 4334 "Get the object's maxDamage level.\n" 4335 "@return datablock.maxDamage\n") 4336{ 4337 return object->getMaxDamage(); 4338} 4339 4340DefineEngineMethod( ShapeBase, setDamageState, bool, ( const char* state ),, 4341 "@brief Set the object's damage state.\n\n" 4342 4343 "@param state should be one of \"Enabled\", \"Disabled\", \"Destroyed\"\n" 4344 "@return true if successful, false if failed\n" 4345 4346 "@see getDamageState()\n") 4347{ 4348 return object->setDamageState( state ); 4349} 4350 4351DefineEngineMethod( ShapeBase, getDamageState, const char*, (),, 4352 "@brief Get the object's damage state.\n\n" 4353 4354 "@return the damage state; one of \"Enabled\", \"Disabled\", \"Destroyed\"\n" 4355 4356 "@see setDamageState()\n") 4357{ 4358 return object->getDamageStateName(); 4359} 4360 4361DefineEngineMethod( ShapeBase, isDestroyed, bool, (),, 4362 "@brief Check if the object is in the Destroyed damage state.\n\n" 4363 4364 "@return true if damage state is \"Destroyed\", false if not\n" 4365 4366 "@see isDisabled()\n" 4367 "@see isEnabled()\n") 4368{ 4369 return object->isDestroyed(); 4370} 4371 4372DefineEngineMethod( ShapeBase, isDisabled, bool, (),, 4373 "@brief Check if the object is in the Disabled or Destroyed damage state.\n\n" 4374 4375 "@return true if damage state is not \"Enabled\", false if it is\n" 4376 4377 "@see isDestroyed()\n" 4378 "@see isEnabled()\n") 4379{ 4380 return object->getDamageState() != ShapeBase::Enabled; 4381} 4382 4383DefineEngineMethod( ShapeBase, isEnabled, bool, (),, 4384 "@brief Check if the object is in the Enabled damage state.\n\n" 4385 4386 "@return true if damage state is \"Enabled\", false if not\n" 4387 4388 "@see isDestroyed()\n" 4389 "@see isDisabled()\n") 4390{ 4391 return object->getDamageState() == ShapeBase::Enabled; 4392} 4393 4394DefineEngineMethod(ShapeBase, blowUp, void, (),, "@brief Explodes an object into pieces.") 4395{ 4396 object->blowUp(); 4397} 4398 4399DefineEngineMethod( ShapeBase, applyDamage, void, ( F32 amount ),, 4400 "@brief Increment the current damage level by the specified amount.\n\n" 4401 4402 "@param amount value to add to current damage level\n" ) 4403{ 4404 object->applyDamage( amount ); 4405} 4406 4407DefineEngineMethod( ShapeBase, applyRepair, void, ( F32 amount ),, 4408 "@brief Repair damage by the specified amount.\n\n" 4409 4410 "Note that the damage level is only reduced by repairRate per tick, so it may " 4411 "take several ticks for the total repair to complete.\n" 4412 4413 "@param amount total repair value (subtracted from damage level over time)\n" ) 4414{ 4415 object->applyRepair( amount ); 4416} 4417 4418DefineEngineMethod( ShapeBase, setRepairRate, void, ( F32 rate ),, 4419 "@brief Set amount to repair damage by each tick.\n\n" 4420 4421 "Note that this value is separate to the repairRate field in ShapeBaseData. " 4422 "This value will be subtracted from the damage level each tick, whereas the " 4423 "ShapeBaseData field limits how much of the applyRepair value is subtracted " 4424 "each tick. Both repair types can be active at the same time.\n" 4425 4426 "@param rate value to subtract from damage level each tick (must be > 0)\n" 4427 4428 "@see getRepairRate()\n") 4429{ 4430 if(rate < 0) 4431 rate = 0; 4432 object->setRepairRate( rate ); 4433} 4434 4435DefineEngineMethod( ShapeBase, getRepairRate, F32, (),, 4436 "@brief Get the per-tick repair amount.\n\n" 4437 4438 "@return the current value to be subtracted from damage level each tick\n" 4439 4440 "@see setRepairRate\n" ) 4441{ 4442 return object->getRepairRate(); 4443} 4444 4445DefineEngineMethod( ShapeBase, setRechargeRate, void, ( F32 rate ),, 4446 "@brief Set the recharge rate.\n\n" 4447 4448 "The recharge rate is added to the object's current energy level each tick, " 4449 "up to the maxEnergy level set in the ShapeBaseData datablock.\n" 4450 4451 "@param rate the recharge rate (per tick)\n" 4452 4453 "@see getRechargeRate()\n") 4454{ 4455 object->setRechargeRate( rate ); 4456} 4457 4458DefineEngineMethod( ShapeBase, getRechargeRate, F32, (),, 4459 "@brief Get the current recharge rate.\n\n" 4460 4461 "@return the recharge rate (per tick)\n" 4462 4463 "@see setRechargeRate()\n") 4464{ 4465 return object->getRechargeRate(); 4466} 4467 4468DefineEngineMethod( ShapeBase, getControllingClient, S32, (),, 4469 "@brief Get the client (if any) that controls this object.\n\n" 4470 4471 "The controlling client is the one that will send moves to us to act on.\n" 4472 4473 "@return the ID of the controlling GameConnection, or 0 if this object is not " 4474 "controlled by any client.\n" 4475 4476 "@see GameConnection\n") 4477{ 4478 if (GameConnection* con = object->getControllingClient()) 4479 return con->getId(); 4480 return 0; 4481} 4482 4483DefineEngineMethod( ShapeBase, getControllingObject, S32, (),, 4484 "@brief Get the object (if any) that controls this object.\n\n" 4485 4486 "@return the ID of the controlling ShapeBase object, or 0 if this object is " 4487 "not controlled by another object.\n" ) 4488{ 4489 if (ShapeBase* con = object->getControllingObject()) 4490 return con->getId(); 4491 return 0; 4492} 4493 4494DefineEngineMethod( ShapeBase, canCloak, bool, (),, 4495 "@brief Check if this object can cloak.\n\n" 4496 "@return true\n" 4497 4498 "@note Not implemented as it always returns true.") 4499{ 4500 return true; 4501} 4502 4503DefineEngineMethod( ShapeBase, setCloaked, void, ( bool cloak ),, 4504 "@brief Set the cloaked state of this object.\n\n" 4505 4506 "When an object is cloaked it is not rendered.\n" 4507 4508 "@param cloak true to cloak the object, false to uncloak\n" 4509 4510 "@see isCloaked()\n") 4511{ 4512 if (object->isServerObject()) 4513 object->setCloakedState( cloak ); 4514} 4515 4516DefineEngineMethod( ShapeBase, isCloaked, bool, (),, 4517 "@brief Check if this object is cloaked.\n\n" 4518 4519 "@return true if cloaked, false if not\n" 4520 4521 "@see setCloaked()\n") 4522{ 4523 return object->getCloakedState(); 4524} 4525 4526DefineEngineMethod( ShapeBase, setDamageFlash, void, ( F32 level ),, 4527 "@brief Set the damage flash level.\n\n" 4528 4529 "Damage flash may be used as a postfx effect to flash the screen when the " 4530 "client is damaged.\n" 4531 4532 "@note Relies on the flash postFx.\n" 4533 4534 "@param level flash level (0-1)\n" 4535 4536 "@see getDamageFlash()\n") 4537{ 4538 if (object->isServerObject()) 4539 object->setDamageFlash( level ); 4540} 4541 4542DefineEngineMethod( ShapeBase, getDamageFlash, F32, (),, 4543 "@brief Get the damage flash level.\n\n" 4544 4545 "@return flash level\n" 4546 4547 "@see setDamageFlash\n" ) 4548{ 4549 return object->getDamageFlash(); 4550} 4551 4552DefineEngineMethod( ShapeBase, setWhiteOut, void, ( F32 level ),, 4553 "@brief Set the white-out level.\n\n" 4554 4555 "White-out may be used as a postfx effect to brighten the screen in response " 4556 "to a game event.\n" 4557 4558 "@note Relies on the flash postFx.\n" 4559 4560 "@param level flash level (0-1)\n" 4561 4562 "@see getWhiteOut()\n") 4563{ 4564 if (object->isServerObject()) 4565 object->setWhiteOut( level ); 4566} 4567 4568DefineEngineMethod( ShapeBase, getWhiteOut, F32, (),, 4569 "@brief Get the white-out level.\n\n" 4570 4571 "@return white-out level\n" 4572 4573 "@see setWhiteOut\n" ) 4574{ 4575 return object->getWhiteOut(); 4576} 4577 4578DefineEngineMethod( ShapeBase, getDefaultCameraFov, F32, (),, 4579 "@brief Returns the default vertical field of view in degrees for this object if used as a camera.\n\n" 4580 4581 "@return Default FOV\n" ) 4582{ 4583 if (object->isServerObject()) 4584 return object->getDefaultCameraFov(); 4585 return 0.0; 4586} 4587 4588DefineEngineMethod( ShapeBase, getCameraFov, F32, (),, 4589 "@brief Returns the vertical field of view in degrees for this object if used as a camera.\n\n" 4590 4591 "@return current FOV as defined in ShapeBaseData::cameraDefaultFov\n" ) 4592{ 4593 if (object->isServerObject()) 4594 return object->getCameraFov(); 4595 return 0.0; 4596} 4597 4598DefineEngineMethod( ShapeBase, setCameraFov, void, ( F32 fov ),, 4599 "@brief Set the vertical field of view in degrees for this object if used as a camera.\n\n" 4600 4601 "@param fov new FOV value\n" ) 4602{ 4603 if (object->isServerObject()) 4604 object->setCameraFov( fov ); 4605} 4606 4607DefineEngineMethod( ShapeBase, startFade, void, ( S32 time, S32 delay, bool fadeOut ),, 4608 "@brief Fade the object in or out without removing it from the scene.\n\n" 4609 4610 "A faded out object is still in the scene and can still be collided with, " 4611 "so if you want to disable collisions for this shape after it fades out " 4612 "use setHidden to temporarily remove this shape from the scene.\n" 4613 4614 "@note Items have the ability to light their surroundings. When an Item with " 4615 "an active light is fading out, the light it emits is correspondingly " 4616 "reduced until it goes out. Likewise, when the item fades in, the light is " 4617 "turned-up till it reaches it's normal brightntess.\n" 4618 4619 "@param time duration of the fade effect in ms\n" 4620 "@param delay delay in ms before the fade effect begins\n" 4621 "@param fadeOut true to fade-out to invisible, false to fade-in to full visibility\n" ) 4622{ 4623 object->startFade( (F32)time / (F32)1000.0, delay / 1000.0, fadeOut ); 4624} 4625 4626DefineEngineMethod( ShapeBase, setDamageVector, void, ( Point3F vec ),, 4627 "@brief Set the damage direction vector.\n\n" 4628 4629 "Currently this is only used to initialise the explosion if this object " 4630 "is blown up.\n" 4631 4632 "@param vec damage direction vector\n\n" 4633 4634 "@tsexample\n" 4635 "%obj.setDamageVector( \"0 0 1\" );\n" 4636 "@endtsexample\n" ) 4637{ 4638 vec.normalize(); 4639 object->setDamageDir( vec ); 4640} 4641 4642DefineEngineMethod( ShapeBase, setShapeName, void, ( const char* name ),, 4643 "@brief Set the name of this shape.\n\n" 4644 4645 "@note This is the name of the shape object that is sent to the client, " 4646 "not the DTS or DAE model filename.\n" 4647 4648 "@param name new name for the shape\n\n" 4649 4650 "@see getShapeName()\n") 4651{ 4652 object->setShapeName( name ); 4653} 4654 4655DefineEngineMethod( ShapeBase, getShapeName, const char*, (),, 4656 "@brief Get the name of the shape.\n\n" 4657 4658 "@note This is the name of the shape object that is sent to the client, " 4659 "not the DTS or DAE model filename.\n" 4660 4661 "@return the name of the shape\n\n" 4662 4663 "@see setShapeName()\n") 4664{ 4665 return object->getShapeName(); 4666} 4667 4668DefineEngineMethod( ShapeBase, setSkinName, void, ( const char* name ),, 4669 "@brief Apply a new skin to this shape.\n\n" 4670 4671 "'Skinning' the shape effectively renames the material targets, allowing " 4672 "different materials to be used on different instances of the same model.\n\n" 4673 4674 "@param name name of the skin to apply\n\n" 4675 4676 "@see skin\n" 4677 "@see getSkinName()\n") 4678{ 4679 object->setSkinName( name ); 4680} 4681 4682DefineEngineMethod( ShapeBase, getSkinName, const char*, (),, 4683 "@brief Get the name of the skin applied to this shape.\n\n" 4684 4685 "@return the name of the skin\n\n" 4686 4687 "@see skin\n" 4688 "@see setSkinName()\n") 4689{ 4690 return object->getSkinName(); 4691} 4692 4693//---------------------------------------------------------------------------- 4694void ShapeBase::consoleInit() 4695{ 4696 Con::addVariable("SB::DFDec", TypeF32, &sDamageFlashDec, "Speed to reduce the damage flash effect per tick.\n\n" 4697 "@see ShapeBase::setDamageFlash()\n" 4698 "@see ShapeBase::getDamageFlash()\n" 4699 "@note Relies on the flash postFx.\n" 4700 "@ingroup gameObjects\n"); 4701 Con::addVariable("SB::WODec", TypeF32, &sWhiteoutDec, "Speed to reduce the whiteout effect per tick.\n\n" 4702 "@see ShapeBase::setWhiteOut()\n" 4703 "@see ShapeBase::getWhiteOut" 4704 "@note Relies on the flash postFx.\n" 4705 "@ingroup gameObjects\n"); 4706 Con::addVariable("SB::FullCorrectionDistance", TypeF32, &sFullCorrectionDistance, 4707 "@brief Distance at which a weapon's muzzle vector is fully corrected to match where the player is looking.\n\n" 4708 "When a weapon image has correctMuzzleVector set and the Player is in 1st person, the muzzle vector from the " 4709 "weapon is modified to match where the player is looking. Beyond the FullCorrectionDistance the muzzle vector " 4710 "is always corrected. Between FullCorrectionDistance and the player, the weapon's muzzle vector is adjusted so that " 4711 "the closer the aim point is to the player, the closer the muzzle vector is to the true (non-corrected) one.\n" 4712 "@ingroup gameObjects\n"); 4713 Con::addVariable("SB::CloakSpeed", TypeF32, &sCloakSpeed, 4714 "@brief Time to cloak, in seconds.\n\n" 4715 "@ingroup gameObjects\n"); 4716} 4717 4718void ShapeBase::_updateHiddenMeshes() 4719{ 4720 if ( !mShapeInstance ) 4721 return; 4722 4723 // This may happen at some point in the future... lets 4724 // detect it so that it can be fixed at that time. 4725 AssertFatal( mMeshHidden.getSize() == mShapeInstance->mMeshObjects.size(), 4726 "ShapeBase::_updateMeshVisibility() - Mesh visibility size mismatch!" ); 4727 4728 for ( U32 i = 0; i < mMeshHidden.getSize(); i++ ) 4729 setMeshHidden( i, mMeshHidden.test( i ) ); 4730} 4731 4732void ShapeBase::setMeshHidden( const char *meshName, bool forceHidden ) 4733{ 4734 setMeshHidden( mDataBlock->mShape->findObject( meshName ), forceHidden ); 4735} 4736 4737void ShapeBase::setMeshHidden( S32 meshIndex, bool forceHidden ) 4738{ 4739 if ( meshIndex == -1 || meshIndex >= mMeshHidden.getSize() ) 4740 return; 4741 4742 if ( forceHidden ) 4743 mMeshHidden.set( meshIndex ); 4744 else 4745 mMeshHidden.clear( meshIndex ); 4746 4747 if ( mShapeInstance ) 4748 mShapeInstance->setMeshForceHidden( meshIndex, forceHidden ); 4749 4750 setMaskBits( MeshHiddenMask ); 4751} 4752 4753void ShapeBase::setAllMeshesHidden( bool forceHidden ) 4754{ 4755 if ( forceHidden ) 4756 mMeshHidden.set(); 4757 else 4758 mMeshHidden.clear(); 4759 4760 if ( mShapeInstance ) 4761 { 4762 for ( U32 i = 0; i < mMeshHidden.getSize(); i++ ) 4763 mShapeInstance->setMeshForceHidden( i, forceHidden ); 4764 } 4765 4766 setMaskBits( MeshHiddenMask ); 4767} 4768 4769DefineEngineMethod( ShapeBase, setAllMeshesHidden, void, ( bool hide ),, 4770 "@brief Set the hidden state on all the shape meshes.\n\n" 4771 4772 "This allows you to hide all meshes in the shape, for example, and then only " 4773 "enable a few.\n" 4774 4775 "@param hide new hidden state for all meshes\n\n" ) 4776{ 4777 object->setAllMeshesHidden( hide ); 4778} 4779 4780DefineEngineMethod( ShapeBase, setMeshHidden, void, ( const char* name, bool hide ),, 4781 "@brief Set the hidden state on the named shape mesh.\n\n" 4782 4783 "@param name name of the mesh to hide/show\n" 4784 "@param hide new hidden state for the mesh\n\n" ) 4785{ 4786 object->setMeshHidden( name, hide ); 4787} 4788 4789// Some development-handy functions 4790#ifndef TORQUE_SHIPPING 4791 4792void ShapeBase::dumpMeshVisibility() 4793{ 4794 if ( !mShapeInstance ) 4795 return; 4796 4797 const Vector<TSShapeInstance::MeshObjectInstance> &meshes = mShapeInstance->mMeshObjects; 4798 4799 for ( U32 i = 0; i < meshes.size(); i++) 4800 { 4801 const TSShapeInstance::MeshObjectInstance &mesh = meshes[i]; 4802 4803 const String &meshName = mDataBlock->mShape->getMeshName( i ); 4804 4805 Con::printf( "%d - %s - forceHidden = %s, visibility = %f", 4806 i, 4807 meshName.c_str(), 4808 mesh.forceHidden ? "true" : "false", 4809 mesh.visible ); 4810 } 4811} 4812 4813DefineEngineMethod( ShapeBase, dumpMeshVisibility, void, (),, 4814 "@brief Print a list of visible and hidden meshes in the shape to the console " 4815 "for debugging purposes.\n\n" 4816 "@note Only in a SHIPPING build.\n") 4817{ 4818 object->dumpMeshVisibility(); 4819} 4820 4821#endif // #ifndef TORQUE_SHIPPING 4822 4823//------------------------------------------------------------------------ 4824//These functions are duplicated in tsStatic and shapeBase. 4825//They each function a little differently; but achieve the same purpose of gathering 4826//target names/counts without polluting simObject. 4827 4828DefineEngineMethod( ShapeBase, getTargetName, const char*, ( S32 index ),, 4829 "@brief Get the name of the indexed shape material.\n\n" 4830 4831 "@param index index of the material to get (valid range is 0 - getTargetCount()-1).\n" 4832 "@return the name of the indexed material.\n\n" 4833 4834 "@see getTargetCount()\n") 4835{ 4836 ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); 4837 if(obj) 4838 { 4839 // Try to use the client object (so we get the reskinned targets in the Material Editor) 4840 if ((ShapeBase*)obj->getClientObject()) 4841 obj = (ShapeBase*)obj->getClientObject(); 4842 4843 return obj->getShapeInstance()->getTargetName(index); 4844 } 4845 4846 return ""; 4847} 4848 4849DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, 4850 "@brief Get the number of materials in the shape.\n\n" 4851 4852 "@return the number of materials in the shape.\n\n" 4853 4854 "@see getTargetName()\n") 4855{ 4856 ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); 4857 if(obj) 4858 { 4859 // Try to use the client object (so we get the reskinned targets in the Material Editor) 4860 if ((ShapeBase*)obj->getClientObject()) 4861 obj = (ShapeBase*)obj->getClientObject(); 4862 4863 if (obj->getShapeInstance() != NULL) 4864 return obj->getShapeInstance()->getTargetCount(); 4865 } 4866 4867 return -1; 4868} 4869 4870DefineEngineMethod( ShapeBase, changeMaterial, void, ( const char* mapTo, Material* oldMat, Material* newMat ),, 4871 "@brief Change one of the materials on the shape.\n\n" 4872 4873 "This method changes materials per mapTo with others. The material that " 4874 "is being replaced is mapped to unmapped_mat as a part of this transition.\n" 4875 4876 "@note Warning, right now this only sort of works. It doesn't do a live " 4877 "update like it should.\n" 4878 4879 "@param mapTo the name of the material target to remap (from getTargetName)\n" 4880 "@param oldMat the old Material that was mapped \n" 4881 "@param newMat the new Material to map\n\n" 4882 4883 "@tsexample\n" 4884 "// remap the first material in the shape\n" 4885 "%mapTo = %obj.getTargetName( 0 );\n" 4886 "%obj.changeMaterial( %mapTo, 0, MyMaterial );\n" 4887 "@endtsexample\n" ) 4888{ 4889 // if no valid new material, theres no reason for doing this 4890 if( !newMat ) 4891 { 4892 Con::errorf("ShapeBase::changeMaterial failed: New material does not exist!"); 4893 return; 4894 } 4895 4896 // initilize server/client versions 4897 ShapeBase *serverObj = object; 4898 ShapeBase *clientObj = dynamic_cast< ShapeBase* > ( object->getClientObject() ); 4899 4900 // Check the mapTo name exists for this shape 4901 S32 matIndex = serverObj->getShape()->materialList->getMaterialNameList().find_next(String(mapTo)); 4902 if (matIndex < 0) 4903 { 4904 Con::errorf("ShapeBase::changeMaterial failed: Invalid mapTo name '%s'", mapTo); 4905 return; 4906 } 4907 4908 // Lets remap the old material off, so as to let room for our current material room to claim its spot 4909 if( oldMat ) 4910 oldMat->mMapTo = String("unmapped_mat"); 4911 4912 newMat->mMapTo = mapTo; 4913 4914 // Map the material by name in the matmgr 4915 MATMGR->mapMaterial( mapTo, newMat->getName() ); 4916 4917 // Replace instances with the new material being traded in. For ShapeBase 4918 // class we have to update the server/client objects separately so both 4919 // represent our changes 4920 delete serverObj->getShape()->materialList->mMatInstList[matIndex]; 4921 serverObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance(); 4922 if (clientObj) 4923 { 4924 delete clientObj->getShape()->materialList->mMatInstList[matIndex]; 4925 clientObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance(); 4926 } 4927 4928 // Finish up preparing the material instances for rendering 4929 const GFXVertexFormat *flags = getGFXVertexFormat<GFXVertexPNTTB>(); 4930 FeatureSet features = MATMGR->getDefaultFeatures(); 4931 4932 serverObj->getShape()->materialList->getMaterialInst(matIndex)->init( features, flags ); 4933 if (clientObj) 4934 clientObj->getShapeInstance()->mMaterialList->getMaterialInst(matIndex)->init( features, flags ); 4935} 4936 4937DefineEngineMethod( ShapeBase, getModelFile, const char *, (),, 4938 "@brief Get the model filename used by this shape.\n\n" 4939 4940 "@return the shape filename\n\n" ) 4941{ 4942 GameBaseData * datablock = object->getDataBlock(); 4943 if( !datablock ) 4944 return String::EmptyString; 4945 4946 const char *fieldName = StringTable->insert( String("shapeFile") ); 4947 return datablock->getDataField( fieldName, NULL ); 4948} 4949
