Started unifying locations as Vec3 s
This commit is contained in:
parent
a5914e436b
commit
663869e729
@ -9,6 +9,7 @@ void onStart()
|
||||
SoundEmitter @cowmoo = t_obj.getSoundEmitter();
|
||||
Vec3 newlocation = Vec3(0,2,5);
|
||||
cowmoo.move(newlocation);
|
||||
teleportKart(0,newlocation);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
void onUpdate()
|
||||
{
|
||||
|
||||
Vec3 tele = Vec3(0,0,0);
|
||||
//teleportKart(0,tele);
|
||||
}
|
||||
|
@ -42,10 +42,11 @@ namespace Scripting
|
||||
void teleportKart(asIScriptGeneric *gen)
|
||||
{
|
||||
int id = (int)gen->GetArgDWord(0);
|
||||
Vec3 *position = (Vec3*)gen->GetArgAddress(1);
|
||||
|
||||
float x = gen->GetArgFloat(1);
|
||||
float y = gen->GetArgFloat(2);
|
||||
float z = gen->GetArgFloat(3);
|
||||
float x = position->getX();
|
||||
float y = position->getY();
|
||||
float z = position->getZ();
|
||||
|
||||
AbstractKart* kart = World::getWorld()->getKart(id);
|
||||
kart->setXYZ(btVector3(x, y, z));
|
||||
@ -96,7 +97,7 @@ namespace Scripting
|
||||
{
|
||||
int r;
|
||||
r = engine->RegisterGlobalFunction("void squashKart(int id, float time)", asFUNCTION(squashKart), asCALL_GENERIC); assert(r >= 0);
|
||||
r = engine->RegisterGlobalFunction("void teleportKart(int id, float x, float y,float z)", asFUNCTION(teleportKart), asCALL_GENERIC); assert(r >= 0);
|
||||
r = engine->RegisterGlobalFunction("void teleportKart(int id, Vec3 &in)", asFUNCTION(teleportKart), asCALL_GENERIC); assert(r >= 0);
|
||||
r = engine->RegisterGlobalFunction("void setVelocity(int id, float x, float y,float z)", asFUNCTION(setVelocity), asCALL_GENERIC); assert(r >= 0);
|
||||
r = engine->RegisterGlobalFunction("void jumpKartTo(int id, float x, float y)", asFUNCTION(jumpKartTo), asCALL_GENERIC); assert(r >= 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user