Added wrapper for PhysicalObject->removeBody and bound it to scripts
This commit is contained in:
@@ -6,6 +6,6 @@ void onTrigger()
|
||||
|
||||
*/
|
||||
displayMessage("Haybail reactivated");
|
||||
enableAnimation("hayBail.b3d");
|
||||
//enableAnimation("hayBail.b3d");
|
||||
squashKart(0,35.0); //id of kart,time to squash
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ void onTrigger()
|
||||
TrackObject @t_obj = getTrackObject("hayBail.b3d");
|
||||
//t_obj.setEnable(false);
|
||||
PhysicalObject @haybail = t_obj.getPhysicalObject();
|
||||
if (haybail.isFlattener())squashKart(0,35.0);
|
||||
haybail.disable();
|
||||
//if (haybail.isFlattener())squashKart(0,35.0);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,10 @@ namespace Scripting
|
||||
std::string type = "mesh";
|
||||
World::getWorld()->getTrack()->getTrackObjectManager()->disable(*str, type);
|
||||
}*/
|
||||
void disable(void *memory)
|
||||
{
|
||||
((PhysicalObject*)(memory))->removeBody();
|
||||
}
|
||||
void getTrackObject(asIScriptGeneric *gen)
|
||||
{
|
||||
std::string *str = (std::string*)gen->GetArgAddress(0);
|
||||
@@ -85,7 +89,7 @@ namespace Scripting
|
||||
r = engine->RegisterObjectType("PhysicalObject", 0, asOBJ_REF | asOBJ_NOCOUNT); assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("TrackObject", "PhysicalObject @getPhysicalObject()", asMETHOD(TrackObject, getPhysicalObjectForScript), asCALL_THISCALL); assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("PhysicalObject", "bool isFlattener()", asMETHOD(PhysicalObject, isFlattenKartObject), asCALL_THISCALL); assert(r >= 0);
|
||||
|
||||
r = engine->RegisterObjectMethod("PhysicalObject", "void disable()", asFUNCTION(disable), asCALL_CDECL_OBJLAST); assert(r >= 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user