Commit 05d5dccc authored by D-AIRY's avatar D-AIRY

Renamed SXGame_ to SGame_, SXPhysics_ to SPhysics_

parent 6194f41e
......@@ -451,7 +451,7 @@ void DecalManager::shootDecal(DECAL_TYPE type, const float3 & position, ID iMate
btTransform xForm2;
xForm2.setOrigin(vec + offs);
xForm2.getBasis().setIdentity();
SXPhysics_GetDynWorld()->convexSweepTest(&sphere, xForm, xForm2, cb);
SPhysics_GetDynWorld()->convexSweepTest(&sphere, xForm, xForm2, cb);
AllConvexResultCallback::part * part;
if(cb.hasHit())
{
......@@ -583,9 +583,9 @@ void DecalManager::render()
{
/*for(int i = 0, l = m_dbgRender.size(); i < l; i += 3)
{
SXPhysics_GetDynWorld()->getDebugDrawer()->drawTriangle(F3_BTVEC(m_dbgRender[i]), F3_BTVEC(m_dbgRender[i + 1]), F3_BTVEC(m_dbgRender[i + 2]), btVector3(1.0f, 1.0f, 1.0f), 1.0f);
SPhysics_GetDynWorld()->getDebugDrawer()->drawTriangle(F3_BTVEC(m_dbgRender[i]), F3_BTVEC(m_dbgRender[i + 1]), F3_BTVEC(m_dbgRender[i + 2]), btVector3(1.0f, 1.0f, 1.0f), 1.0f);
}*/
//SXPhysics_GetDynWorld()->getDebugDrawer()->drawSphere(F3_BTVEC(spherePos), spherePos.w, btVector3(1, 1, 1));
//SPhysics_GetDynWorld()->getDebugDrawer()->drawSphere(F3_BTVEC(spherePos), spherePos.w, btVector3(1, 1, 1));
updateBuffer();
......
......@@ -112,7 +112,7 @@ void CBaseAmmo::fire(const float3 &_vStart, const float3 &_vDir, CBaseCharacter
cb.m_collisionFilterGroup = CG_BULLETFIRE;
cb.m_collisionFilterMask = CG_ALL & ~(CG_DEBRIS | CG_TRIGGER | CG_CHARACTER);
cb.m_flags |= btTriangleRaycastCallback::kF_FilterBackfaces;
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(vStart), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(vStart), F3_BTVEC(end), cb);
g_pTracer->lineTo(vStart, 0.0f);
//g_pTracer->begin(vStart);
......@@ -120,7 +120,7 @@ void CBaseAmmo::fire(const float3 &_vStart, const float3 &_vDir, CBaseCharacter
{
AllHitsNotMeRayResultCallback cbBack(pAttacker ? pAttacker->getBtCollisionObject() : NULL, F3_BTVEC(end), F3_BTVEC(vStart));
cbBack.m_flags |= btTriangleRaycastCallback::kF_FilterBackfaces;
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(end), F3_BTVEC(vStart), cbBack);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(end), F3_BTVEC(vStart), cbBack);
Array<HitPoint> aHitPoints;
aHitPoints.reserve(cb.m_hitFractions.size() + cbBack.m_hitFractions.size());
......@@ -141,7 +141,7 @@ void CBaseAmmo::fire(const float3 &_vStart, const float3 &_vDir, CBaseCharacter
for(int i = 0, l = aHitPoints.size(); i < l; ++i)
{
ID idMtl = SXPhysics_GetMtlID(aHitPoints[i].pCollisionObject, &aHitPoints[i].shapeInfo);
ID idMtl = SPhysics_GetMtlID(aHitPoints[i].pCollisionObject, &aHitPoints[i].shapeInfo);
if(ID_VALID(idMtl) && !aHitPoints[i].isExit)
{
float fHitChance = SMtrl_MtlGetHitChance(idMtl);
......
......@@ -221,9 +221,9 @@ void CBaseAnimating::initPhysics()
tmpShape.setMargin(0);
btVector3 *pData;
int iVertexCount;
SXPhysics_BuildHull(&tmpShape, &pData, &iVertexCount);
SPhysics_BuildHull(&tmpShape, &pData, &iVertexCount);
m_pCollideShape = new btConvexHullShape((float*)pData, iVertexCount, sizeof(btVector3));
SXPhysics_ReleaseHull(pData, iVertexCount);
SPhysics_ReleaseHull(pData, iVertexCount);
}
break;
......@@ -262,7 +262,7 @@ void CBaseAnimating::createPhysBody()
colGroup = CG_STATIC;
colMask = CG_STATIC_MASK;
}
SXPhysics_AddShapeEx(m_pRigidBody, colGroup, colMask);
SPhysics_AddShapeEx(m_pRigidBody, colGroup, colMask);
if(m_isStatic)
{
......@@ -274,7 +274,7 @@ void CBaseAnimating::createPhysBody()
void CBaseAnimating::removePhysBody()
{
SXPhysics_RemoveShape(m_pRigidBody);
SPhysics_RemoveShape(m_pRigidBody);
mem_delete(m_pRigidBody);
}
......@@ -294,8 +294,8 @@ void CBaseAnimating::setCollisionGroup(COLLISION_GROUP group, COLLISION_GROUP ma
m_collisionMask = mask;
if(m_pRigidBody)
{
SXPhysics_RemoveShape(m_pRigidBody);
SXPhysics_AddShapeEx(m_pRigidBody, m_collisionGroup, m_collisionMask);
SPhysics_RemoveShape(m_pRigidBody);
SPhysics_AddShapeEx(m_pRigidBody, m_collisionGroup, m_collisionMask);
}
}
COLLISION_GROUP CBaseAnimating::getCollisionGroup()
......@@ -391,16 +391,16 @@ void CBaseAnimating::onIsStaticChange(bool isStatic)
m_pRigidBody->setLinearFactor(btVector3(0.0f, 0.0f, 0.0f));
m_pRigidBody->setAngularFactor(btVector3(0.0f, 0.0f, 0.0f));
SXPhysics_RemoveShape(m_pRigidBody);
SXPhysics_AddShapeEx(m_pRigidBody, CG_STATIC, CG_STATIC_MASK);
SPhysics_RemoveShape(m_pRigidBody);
SPhysics_AddShapeEx(m_pRigidBody, CG_STATIC, CG_STATIC_MASK);
}
else
{
m_pRigidBody->setLinearFactor(btVector3(1.0f, 1.0f, 1.0f));
m_pRigidBody->setAngularFactor(btVector3(1.0f, 1.0f, 1.0f));
SXPhysics_RemoveShape(m_pRigidBody);
SXPhysics_AddShapeEx(m_pRigidBody, m_collisionGroup, m_collisionMask);
SPhysics_RemoveShape(m_pRigidBody);
SPhysics_AddShapeEx(m_pRigidBody, m_collisionGroup, m_collisionMask);
}
}
m_isStatic = isStatic;
......
......@@ -98,11 +98,11 @@ CBaseCharacter::CBaseCharacter(CEntityManager * pMgr):
//m_pCharacter->setFallSpeed(30.0f);
m_pCharacter->setMaxPenetrationDepth(0.1f);
SXPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_CHARACTER, CG_ALL & ~(CG_DEBRIS | CG_HITBOX | CG_WATER));
SPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_CHARACTER, CG_ALL & ~(CG_DEBRIS | CG_HITBOX | CG_WATER));
//m_pGhostObject->setCollisionFlags(m_pGhostObject->getCollisionFlags() | btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT);
SXPhysics_GetDynWorld()->addAction(m_pCharacter);
SPhysics_GetDynWorld()->addAction(m_pCharacter);
m_flashlight = (CLightDirectional*)CREATE_ENTITY("light_directional", m_pMgr);
......@@ -207,11 +207,11 @@ void CBaseCharacter::playFootstepsSound()
float3 start = getPos() + float3(0.0f, 0.5f, 0.0f),
end = start + float3(0.0f, -2.0f, 0.0f);
btKinematicClosestNotMeRayResultCallback cb(m_pGhostObject, F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
if(cb.hasHit()/* && cb.m_shapeInfo.m_shapePart == 0 && cb.m_shapeInfo.m_triangleIndex >= 0*/)
{
MTLTYPE_PHYSIC type = (MTLTYPE_PHYSIC)SXPhysics_GetMtlType(cb.m_collisionObject, &cb.m_shapeInfo);
MTLTYPE_PHYSIC type = (MTLTYPE_PHYSIC)SPhysics_GetMtlType(cb.m_collisionObject, &cb.m_shapeInfo);
g_pGameData->playFootstepSound(type, BTVEC_F3(cb.m_hitPointWorld));
}
}
......@@ -231,7 +231,7 @@ float CBaseCharacter::getAimRange()
float3 end = start + dir * 1000.0f;
btKinematicClosestNotMeRayResultCallback cb(m_pGhostObject, F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
if(cb.hasHit())
{
......@@ -363,7 +363,7 @@ void CBaseCharacter::initHitboxes()
pRigidBody->setCollisionFlags(pRigidBody->getCollisionFlags() | btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT);
SXPhysics_AddShapeEx(pRigidBody, CG_HITBOX, CG_BULLETFIRE);
SPhysics_AddShapeEx(pRigidBody, CG_HITBOX, CG_BULLETFIRE);
m_pHitboxBodies[i] = pRigidBody;
}
......@@ -404,7 +404,7 @@ void CBaseCharacter::releaseHitboxes()
for(int i = 0, l = m_pAnimPlayer->getHitboxCount(); i < l; ++i)
{
SXPhysics_RemoveShape(m_pHitboxBodies[i]);
SPhysics_RemoveShape(m_pHitboxBodies[i]);
btMotionState * motionState = m_pHitboxBodies[i]->getMotionState();
......@@ -483,8 +483,8 @@ void CBaseCharacter::onDeath(CBaseEntity *pAttacker, CBaseEntity *pInflictor)
m_idQuadCurr = -1;
}
SXPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
SXPhysics_GetDynWorld()->removeAction(m_pCharacter);
SPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
SPhysics_GetDynWorld()->removeAction(m_pCharacter);
cancelNextAnimation();
......@@ -521,7 +521,7 @@ void CBaseCharacter::use(bool start)
float3 end = start + dir * 1.5f;
btKinematicClosestNotMeRayResultCallback cb(m_pGhostObject, F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
if(cb.hasHit())
{
......
......@@ -135,7 +135,7 @@ void CBaseTool::primaryAction(BOOL st)
float3 dir = m_pParent->getOrient() * float3(0.0f, 0.0f, 1.0f);
float3 end = start + dir * m_fMaxDistance;
btCollisionWorld::ClosestRayResultCallback cb(F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
if(cb.hasHit())
{
......
......@@ -64,7 +64,7 @@ void CBaseTrigger::enable()
m_idUpdateInterval = SET_INTERVAL(update, 0);
if(m_pGhostObject)
{
SXPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_TRIGGER, CG_CHARACTER);
SPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_TRIGGER, CG_CHARACTER);
}
}
}
......@@ -76,7 +76,7 @@ void CBaseTrigger::disable()
CLEAR_INTERVAL(m_idUpdateInterval);
if(m_pGhostObject)
{
SXPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
SPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
}
}
}
......@@ -115,7 +115,7 @@ void CBaseTrigger::createPhysBody()
m_pGhostObject->setCollisionShape(m_pCollideShape);
m_pGhostObject->setCollisionFlags(m_pGhostObject->getCollisionFlags() ^ btCollisionObject::CF_NO_CONTACT_RESPONSE);
SXPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_TRIGGER, CG_CHARACTER);
SPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_TRIGGER, CG_CHARACTER);
}
}
......@@ -123,7 +123,7 @@ void CBaseTrigger::removePhysBody()
{
if(m_pGhostObject)
{
SXPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
SPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
mem_delete(m_pGhostObject);
}
}
......@@ -157,7 +157,7 @@ void CBaseTrigger::onSync()
for(int i = 0; i < iTouches; ++i)
{
const btBroadphasePair &pair = pairArray[i];
btBroadphasePair *pCollisionPair = SXPhysics_GetDynWorld()->getPairCache()->findPair(pair.m_pProxy0, pair.m_pProxy1);
btBroadphasePair *pCollisionPair = SPhysics_GetDynWorld()->getPairCache()->findPair(pair.m_pProxy0, pair.m_pProxy1);
if(!pCollisionPair)
{
continue;
......
......@@ -184,11 +184,11 @@ GameData::GameData(HWND hWnd, bool isGame):
return;
}
LibReport(REPORT_MSG_LEVEL_NOTICE, "load entity\n");
SXGame_LoadEnts(argv[1]);
SXGame_OnLevelLoad(argv[2]);
SGame_LoadEnts(argv[1]);
SGame_OnLevelLoad(argv[2]);
});
Core_0RegisterConcmd("ent_unload_level", [](){
SXGame_UnloadObjLevel();
SGame_UnloadObjLevel();
});
Core_0RegisterConcmdArg("ent_save_level", [](int argc, const char ** argv){
if(argc != 2)
......@@ -196,7 +196,7 @@ GameData::GameData(HWND hWnd, bool isGame):
printf("Usage: ent_save_level <entfile>");
return;
}
SXGame_SaveEnts(argv[1]);
SGame_SaveEnts(argv[1]);
});
Core_0RegisterConcmdArg("ent_dump_info", [](int argc, const char ** argv)
......@@ -231,7 +231,7 @@ GameData::GameData(HWND hWnd, bool isGame):
for(int i = 0; i < 0; ++i)
{
CBaseEntity* bEnt = SXGame_CreateEntity("npc_zombie");
CBaseEntity* bEnt = SGame_CreateEntity("npc_zombie");
bEnt->setFlags(bEnt->getFlags() | EF_EXPORT | EF_LEVEL);
bEnt->setKV("origin", "0 1 0");
}
......@@ -801,7 +801,7 @@ void GameData::update()
for(int i = 0; i < 60000; ++i)
{
btCollisionWorld::ClosestRayResultCallback cb(F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
}
DWORD t1 = GetTickCount();
printf(COLOR_LRED "TIME: %.3fs\n" COLOR_RESET, (float)(t1 - t0) / 1000.0f);*/
......
......@@ -62,7 +62,7 @@ void CIngameGameState::activate()
Core_TimeWorkingSet(idTimerRender, true);
SSCore_ChannelPlay(SX_SOUND_CHANNEL_GAME);
SSInput_SetEnable(true);
SXPhysics_EnableSimulation();
SPhysics_EnableSimulation();
}
void CIngameGameState::deactivate()
......@@ -71,7 +71,7 @@ void CIngameGameState::deactivate()
Core_TimeWorkingSet(idTimerRender, false);
SSCore_ChannelStop(SX_SOUND_CHANNEL_GAME);
SSInput_SetEnable(false);
SXPhysics_DisableSimulation();
SPhysics_DisableSimulation();
}
//##########################################################################
......
......@@ -309,7 +309,7 @@ void CNPCBase::pathFollowThinker(float fDelta)
//g_pTracer2->begin(m_vPosition, 1);
//g_pTracer2->lineTo(m_vPosition + vDir * fMovDirLen, 1);
//g_pTracer2->end();
//SXPhysics_GetDynWorld()->getDebugDrawer()->drawLine(F3_BTVEC(m_vLastPathPos), F3_BTVEC(m_vPosition), btVector3(0, 1, 0));
//SPhysics_GetDynWorld()->getDebugDrawer()->drawLine(F3_BTVEC(m_vLastPathPos), F3_BTVEC(m_vPosition), btVector3(0, 1, 0));
m_qOrientTo = SMQuaternion(NPC_BASE_DIR, vDir);
setOrient(SMquaternionSlerp(m_vOrientation, m_qOrientTo, clampf(fDelta, 0.1f, 1.0f)));
......@@ -402,7 +402,7 @@ float CNPCBase::canSee(CBaseEntity *pOther)
CClosestNotMeRayResultCallback cb(getBtCollisionObject(), F3_BTVEC(m_pHeadEnt->getPos()), F3_BTVEC(pOther->getPos()));
cb.m_collisionFilterGroup = CG_NPCVIEW;
cb.m_collisionFilterMask = CG_ALL & ~(CG_DEBRIS | CG_TRIGGER | CG_CHARACTER);
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(m_pHeadEnt->getPos()), F3_BTVEC(pOther->getPos()), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(m_pHeadEnt->getPos()), F3_BTVEC(pOther->getPos()), cb);
if(cb.hasHit())
{
......@@ -580,11 +580,11 @@ void CNPCBase::onSync()
rot = SMQuaternion(SM_PI, 'y') * rot;
transform.getBasis().setRotation(Q4_BTQUAT(rot));
SXPhysics_GetDynWorld()->getDebugDrawer()->drawCone(m_fViewDistance * tanf(m_fViewConeAngle), m_fViewDistance, 2, transform, btVector3(1, 1, 1));
SPhysics_GetDynWorld()->getDebugDrawer()->drawCone(m_fViewDistance * tanf(m_fViewConeAngle), m_fViewDistance, 2, transform, btVector3(1, 1, 1));
*/
//SMQuaternion rot = m_pHeadEnt->getOrient();
//SXPhysics_GetDynWorld()->getDebugDrawer()->drawLine(F3_BTVEC(m_pHeadEnt->getPos()), F3_BTVEC(m_pHeadEnt->getPos() + (rot * float3(0,0,1))), btVector3(1,1,1));
//SPhysics_GetDynWorld()->getDebugDrawer()->drawLine(F3_BTVEC(m_pHeadEnt->getPos()), F3_BTVEC(m_pHeadEnt->getPos() + (rot * float3(0,0,1))), btVector3(1,1,1));
}
#if 0
void CNPCBase::gridCheckBeyond()
......
......@@ -456,8 +456,8 @@ void CPlayer::respawn()
{
m_fHealth = 100.0f;
SXPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_CHARACTER, CG_ALL & ~(CG_DEBRIS | CG_HITBOX | CG_WATER));
SXPhysics_GetDynWorld()->addAction(m_pCharacter);
SPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_CHARACTER, CG_ALL & ~(CG_DEBRIS | CG_HITBOX | CG_WATER));
SPhysics_GetDynWorld()->addAction(m_pCharacter);
spawn();
}
}
......
......@@ -221,7 +221,7 @@ void CPropDoor::createPhysBody()
m_pGhostObject->setCollisionFlags(btCollisionObject::CF_KINEMATIC_OBJECT);
m_pGhostObject->setUserPointer(this);
SXPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_DOOR, CG_CHARACTER | CG_DEFAULT);
SPhysics_GetDynWorld()->addCollisionObject(m_pGhostObject, CG_DOOR, CG_CHARACTER | CG_DEFAULT);
//m_pGhostObject->activate();
//m_pGhostObject->setActivationState(DISABLE_DEACTIVATION);
......@@ -277,7 +277,7 @@ void CPropDoor::removePhysBody()
{
if(m_pGhostObject)
{
SXPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
SPhysics_GetDynWorld()->removeCollisionObject(m_pGhostObject);
mem_delete(m_pGhostObject);
}
......@@ -369,7 +369,7 @@ bool CPropDoor::testPenetration()
if(!needsCollision(obj0, obj1))
continue;
btBroadphasePair *pCollisionPair = SXPhysics_GetDynWorld()->getPairCache()->findPair(collisionPair->m_pProxy0, collisionPair->m_pProxy1);
btBroadphasePair *pCollisionPair = SPhysics_GetDynWorld()->getPairCache()->findPair(collisionPair->m_pProxy0, collisionPair->m_pProxy1);
if(pCollisionPair->m_algorithm)
pCollisionPair->m_algorithm->getAllContactManifolds(manifoldArray);
......
......@@ -181,7 +181,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
pCTC->setLimit(SM_PIDIV4, SM_PIDIV4, SM_PIDIV2);
m_ppJoints[0] = pCTC;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[0], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[0], true);
}
{
btTransform localA, localB;
......@@ -202,7 +202,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
pCTC->setLimit(SM_PIDIV2, SM_PIDIV2, 0);
m_ppJoints[1] = pCTC;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[1], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[1], true);
}
{
btTransform localA, localB;
......@@ -223,7 +223,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
pCTC->setLimit(SM_PIDIV2, SM_PIDIV2, 0);
m_ppJoints[2] = pCTC;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[2], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[2], true);
}
{
......@@ -247,7 +247,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
//pHinge->setAngularOnly(true);
m_ppJoints[3] = pHinge;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[3], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[3], true);
}
{
btTransform localA, localB;
......@@ -270,7 +270,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
//pHinge->setAngularOnly(true);
m_ppJoints[4] = pHinge;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[4], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[4], true);
}
{
btTransform localA, localB;
......@@ -293,7 +293,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
//joint6DOF->setAngularUpperLimit(btVector3(SIMD_PI*0.2, SIMD_EPSILON, SIMD_PI*0.6));
m_ppJoints[5] = joint6DOF;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[5], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[5], true);
}
{
btTransform localA, localB;
......@@ -316,7 +316,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
joint6DOF->setAngularUpperLimit(btVector3(SIMD_PI*0.2, SIMD_EPSILON, SIMD_PI*0.6));
m_ppJoints[6] = joint6DOF;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[6], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[6], true);
}
{
......@@ -338,7 +338,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
pCTC->setLimit(SM_PIDIV4, SM_PIDIV4, 0);
m_ppJoints[7] = pCTC;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[7], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[7], true);
}
{
btTransform localA, localB;
......@@ -359,7 +359,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
pCTC->setLimit(SM_PIDIV4, SM_PIDIV4, 0);
m_ppJoints[8] = pCTC;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[8], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[8], true);
}
{
btTransform localA, localB;
......@@ -382,7 +382,7 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
//pHinge->setAngularOnly(true);
m_ppJoints[9] = pHinge;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[9], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[9], true);
}
{
btTransform localA, localB;
......@@ -405,13 +405,13 @@ CRagdoll::CRagdoll(IAnimPlayer *pAnimPlayer)
//pHinge->setAngularOnly(true);
m_ppJoints[10] = pHinge;
SXPhysics_GetDynWorld()->addConstraint(m_ppJoints[10], true);
SPhysics_GetDynWorld()->addConstraint(m_ppJoints[10], true);
}
/*SXPhysics_GetDynWorld()->getDebugDrawer()->setDebugMode(
SXPhysics_GetDynWorld()->getDebugDrawer()->getDebugMode()
/*SPhysics_GetDynWorld()->getDebugDrawer()->setDebugMode(
SPhysics_GetDynWorld()->getDebugDrawer()->getDebugMode()
| btIDebugDraw::DBG_DrawConstraintLimits | btIDebugDraw::DBG_DrawConstraints
);*/
......@@ -426,7 +426,7 @@ CRagdoll::~CRagdoll()
// Remove all constraints
for(i = 0; i < m_iJointsCount; ++i)
{
SXPhysics_GetDynWorld()->removeConstraint(m_ppJoints[i]);
SPhysics_GetDynWorld()->removeConstraint(m_ppJoints[i]);
mem_delete(m_ppJoints[i]);
}
mem_delete_a(m_ppJoints);
......@@ -434,7 +434,7 @@ CRagdoll::~CRagdoll()
// Remove all bodies and shapes
for(i = 0; i < m_iBodiesCount; ++i)
{
SXPhysics_GetDynWorld()->removeRigidBody(m_bodies[i]);
SPhysics_GetDynWorld()->removeRigidBody(m_bodies[i]);
delete m_bodies[i]->getMotionState();
......@@ -477,7 +477,7 @@ btRigidBody *CRagdoll::localCreateRigidBody(btScalar mass, const btTransform& st
rbInfo.m_additionalDamping = true;
btRigidBody* body = new btRigidBody(rbInfo);
SXPhysics_GetDynWorld()->addRigidBody(body);
SPhysics_GetDynWorld()->addRigidBody(body);
return body;
}
......@@ -70,7 +70,7 @@ void CZombieHands::actualShoot(float dt)
float3 end = start + dir * m_fEffectiveDistance;
btKinematicClosestNotMeRayResultCallback cb(pOwner->getBtCollisionObject(), F3_BTVEC(start), F3_BTVEC(end));
SXPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
SPhysics_GetDynWorld()->rayTest(F3_BTVEC(start), F3_BTVEC(end), cb);
//g_pTracer->begin(start);
//g_pTracer->lineTo(end);
......
......@@ -172,99 +172,99 @@ See the license in LICENSE
/*! Инициализирует библиотеку
*/
SX_LIB_API void SXGame_0Create(HWND hWnd, bool isGame);
SX_LIB_API void SGame_0Create(HWND hWnd, bool isGame);
/*! Деинициализирует библиотеку
*/
SX_LIB_API void SXGame_AKill();
SX_LIB_API void SGame_AKill();
/*! Устанавливает функцию сообщений
*/
SX_LIB_API void SXGame_Dbg_Set(report_func rf);
SX_LIB_API void SGame_Dbg_Set(report_func rf);
/*! Устанавливает количество потоков обновления
*/
SX_LIB_API void SXGame_UpdateSetThreadNum(int num);
SX_LIB_API void SGame_UpdateSetThreadNum(int num);
/*! Выполняет обновление
@param[in] thread Номер потока, выполняющего обновление
*/
SX_LIB_API void SXGame_Update(int thread = 0);
SX_LIB_API void SGame_Update(int thread = 0);
/*! Выполняет синхронизацию. Для многопоточного обновления
*/
SX_LIB_API void SXGame_Sync();
SX_LIB_API void SGame_Sync();
/*! Загружает список entity из файла
*/
SX_LIB_API void SXGame_LoadEnts(const char * file);
SX_LIB_API void SGame_LoadEnts(const char * file);
/*! Выгрузка игровых объеков уровня */
SX_LIB_API void SXGame_UnloadObjLevel();
SX_LIB_API void SGame_UnloadObjLevel();
/*! Сохраняет объекты в файл
*/
SX_LIB_API void SXGame_SaveEnts(const char * file);
SX_LIB_API void SGame_SaveEnts(const char * file);
/*! Помещает игрока в мир
*/
SX_LIB_API void SXGame_PlayerSpawn();
SX_LIB_API void SGame_PlayerSpawn();
SX_LIB_API void SXGame_Render();
SX_LIB_API void SXGame_RenderHUD();
SX_LIB_API void SGame_Render();
SX_LIB_API void SGame_RenderHUD();
SX_LIB_API void SXGame_EditorRender(ID id, ID id_sel_tex, const float3 *pvRenderPos=NULL);
SX_LIB_API void SGame_EditorRender(ID id, ID id_sel_tex, const float3 *pvRenderPos=NULL);
SX_LIB_API ICamera * SXGame_GetActiveCamera();
SX_LIB_API ICamera * SGame_GetActiveCamera();
/*! Получает количество зарегистрированных классов entity
*/
SX_LIB_API int SXGame_EntGetClassListCount();
SX_LIB_API int SGame_EntGetClassListCount();
/*! Получает список зарегистрированных классов entity.
Память под массив const char * должна быть выделена заранее
*/
SX_LIB_API void SXGame_EntGetClassList(const char ** pszClassList, int count);
SX_LIB_API void SGame_EntGetClassList(const char ** pszClassList, int count);
/*! Создает entity заданного класса
*/
SX_LIB_API CBaseEntity * SXGame_CreateEntity(const char * classname);
SX_LIB_API CBaseEntity * SGame_CreateEntity(const char * classname);
/*! Уничтожает entity
*/
SX_LIB_API void SXGame_RemoveEntity(CBaseEntity * pEnt);
SX_LIB_API void SGame_RemoveEntity(CBaseEntity * pEnt);
/*! Получает таблицу свойств для заданного класса
*/
SX_LIB_API proptable_t * SXGame_EntGetProptable(const char * classname);
SX_LIB_API proptable_t * SGame_EntGetProptable(const char * classname);
/*! Получает значение свойства по умолчанию для заданного класса
*/
SX_LIB_API const char * SXGame_EntGetDefault(const char * classname, const char * key);
SX_LIB_API const char * SGame_EntGetDefault(const char * classname, const char * key);
/*! Количество всех entity
*/
SX_LIB_API int SXGame_EntGetCount();
SX_LIB_API int SGame_EntGetCount();
/*! Возвращает entity по его id
*/
SX_LIB_API CBaseEntity *SXGame_EntGet(ID id);
SX_LIB_API CBaseEntity *SGame_EntGet(ID id);
SX_LIB_API CBaseEntity *SXGame_EntGetByName(const char *szName, ID idStart = 0);
SX_LIB_API CBaseEntity *SGame_EntGetByName(const char *szName, ID idStart = 0);
SX_LIB_API BOOL SXGame_AddWMsg(UINT message, WPARAM wParam, LPARAM lParam);
SX_LIB_API BOOL SGame_AddWMsg(UINT message, WPARAM wParam, LPARAM lParam);
SX_LIB_API void SXGame_OnLostDevice();
SX_LIB_API void SGame_OnLostDevice();
SX_LIB_API void SXGame_OnResetDevice();
SX_LIB_API void SGame_OnResetDevice();
SX_LIB_API void SXGame_OnLevelLoad(const char *szName);
SX_LIB_API void SGame_OnLevelLoad(const char *szName);
SX_LIB_API void SXGame_SetDebugText(const char *szText);
SX_LIB_API void SGame_SetDebugText(const char *szText);
/*! Копирует объект, возвращает ID копии
*/
SX_LIB_API ID SXGame_EntClone(ID idSrc);
SX_LIB_API ID SGame_EntClone(ID idSrc);
#endif
......
......@@ -102,13 +102,13 @@ void ccmd_save_as(int argc, const char ** argv)
}
}
SX_LIB_API ICamera * SXGame_GetActiveCamera()
SX_LIB_API ICamera * SGame_GetActiveCamera()
{
SG_PRECOND(NULL);
return(GameData::m_pActiveCamera->getCamera());
}
SX_LIB_API void SXGame_0Create(HWND hWnd, bool isGame)
SX_LIB_API void SGame_0Create(HWND hWnd, bool isGame)
{
if(g_pGameData)
{
......@@ -125,14 +125,14 @@ SX_LIB_API void SXGame_0Create(HWND hWnd, bool isGame)
Core_0RegisterConcmd("add_corner", ccmd_cam_pt);
Core_0RegisterConcmdArg("ent_save", ccmd_save_as);
}
SX_LIB_API void SXGame_AKill()
SX_LIB_API void SGame_AKill()
{
SG_PRECOND(_VOID);
mem_delete(g_pGameData);
mem_release(g_pFigureBox);
}
SX_LIB_API void SXGame_Update(int thread)
SX_LIB_API void SGame_Update(int thread)
{
SG_PRECOND(_VOID);
GameData::m_pMgr->update(thread);
......@@ -141,66 +141,66 @@ SX_LIB_API void SXGame_Update(int thread)
g_pGameData->update();
}
}
SX_LIB_API void SXGame_UpdateSetThreadNum(int num)
SX_LIB_API void SGame_UpdateSetThreadNum(int num)
{
SG_PRECOND(_VOID);
GameData::m_pMgr->setThreadNum(num);
}
SX_LIB_API void SXGame_Sync()
SX_LIB_API void SGame_Sync()
{
SG_PRECOND(_VOID);
GameData::m_pMgr->sync();
g_pGameData->sync();
}
SX_LIB_API void SXGame_Render()
SX_LIB_API void SGame_Render()
{
SG_PRECOND(_VOID);
//GameData::m_pMgr->render();
g_pGameData->render();
}
SX_LIB_API void SXGame_RenderHUD()
SX_LIB_API void SGame_RenderHUD()
{
SG_PRECOND(_VOID);
g_pGameData->renderHUD();
}
SX_LIB_API void SXGame_Dbg_Set(report_func rf)
SX_LIB_API void SGame_Dbg_Set(report_func rf)
{
g_fnReportf = rf;
}
SX_LIB_API void SXGame_LoadEnts(const char * file)
SX_LIB_API void SGame_LoadEnts(const char * file)
{
SG_PRECOND(_VOID);
GameData::m_pMgr->import(file);
}
SX_LIB_API void SXGame_UnloadObjLevel()
SX_LIB_API void SGame_UnloadObjLevel()
{
SG_PRECOND(_VOID);
GameData::m_pMgr->unloadObjLevel();
}
SX_LIB_API void SXGame_SaveEnts(const char * file)
SX_LIB_API void SGame_SaveEnts(const char * file)
{
SG_PRECOND(_VOID);
GameData::m_pMgr->exportList(file);
}
SX_LIB_API void SXGame_PlayerSpawn()
SX_LIB_API void SGame_PlayerS