GL - init objects
This commit is contained in:
parent
9038277a2c
commit
975894b037
|
@ -26,14 +26,14 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
{
|
||||
case ObjectSpecialType_None:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Sky:
|
||||
{
|
||||
float skySize = ((SkyAttributes*)obj)->skySize;
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_World:
|
||||
|
@ -43,29 +43,29 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
|
||||
float worldSize = ((WorldAttributes*)obj)->worldSize;
|
||||
float atmosphereSize = ((WorldAttributes*)obj)->atmoSphereSize;
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Building:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
case ObjectSpecialType_Stone:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_StandardBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_RedExplosiveBox:
|
||||
{
|
||||
int dmg = 50;
|
||||
Oyster::Math::Float3 force(50, 50,50);
|
||||
Oyster::Math::Float force = 50;
|
||||
int radie = 50;
|
||||
gameObj = new ExplosiveCrate(rigidBody, (ObjectSpecialType)obj->specialTypeID,objID++, dmg, force, radie);
|
||||
gameObj = new ExplosiveCrate(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++, dmg, force, radie);
|
||||
}
|
||||
break;
|
||||
//case ObjectSpecialType_BlueExplosiveBox:
|
||||
|
@ -74,24 +74,24 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
// break;
|
||||
case ObjectSpecialType_SpikeBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Spike:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalFormation:
|
||||
{
|
||||
int dmg = 50;
|
||||
//gameObj = new Crystal(rigidBody);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalShard:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_JumpPad:
|
||||
|
@ -99,19 +99,19 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
float power = ((JumpPadAttributes*)obj)->power;
|
||||
Oyster::Math::Float3 dir = ((JumpPadAttributes*)obj)->direction;
|
||||
Oyster::Math::Float3 pushForce = dir * power;
|
||||
gameObj = new JumpPad(rigidBody, (ObjectSpecialType)obj->specialTypeID,objID++ , pushForce);
|
||||
gameObj = new JumpPad(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++ , pushForce);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Portal:
|
||||
{
|
||||
Oyster::Math::Float3 destination = ((PortalAttributes*)obj)->destination;
|
||||
gameObj = new Portal(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++, destination);
|
||||
gameObj = new Portal(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++, destination);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_SpawnPoint:
|
||||
{
|
||||
// save
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Player:
|
||||
|
@ -122,12 +122,12 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
break;
|
||||
case ObjectSpecialType_Generic:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID,objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue