1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

code correction

This commit is contained in:
Jason Hooks 2012-05-29 22:03:00 -04:00
parent 0066ef9b54
commit fb4e7f02b9
3 changed files with 10 additions and 8 deletions

View File

@ -119,7 +119,7 @@ namespace MWClass
void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
{ {
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
ptr.get<ESM::NPC>(); ptr.get<ESM::NPC>();
@ -128,12 +128,12 @@ namespace MWClass
std::string headID = ref->base->head; std::string headID = ref->base->head;
std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4); std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_"; bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
std::string smodel = "meshes\\base_anim.nif"; std::string smodel = "meshes\\base_anim.nif";
if(beast) if(beast)
smodel = "meshes\\base_animkna.nif"; smodel = "meshes\\base_animkna.nif";
physics.insertActorPhysics(ptr, smodel); physics.insertObjectPhysics(ptr, smodel);
} }

View File

@ -232,7 +232,7 @@ bool PM_SlideMove( bool gravity )
end = pm->ps.origin + pm->ps.velocity * time_left; end = pm->ps.origin + pm->ps.velocity * time_left;
// see if we can make it there // see if we can make it there
//pm->trace ( &trace, pm->ps->origin, pm->mins, pm->maxs, end, pm->ps->clientNum, pm->tracemask); //pm->trace ( &trace, pm->ps->origin, pm->mins, pm->maxs, end, pm->ps->clientNum, pm->tracemaskg);
//tracefunc(&trace, *(const D3DXVECTOR3* const)&(pm->ps.origin), *(const D3DXVECTOR3* const)&(end), *(const D3DXVECTOR3* const)&(pm->ps.velocity), 0, pml.traceObj); //tracefunc(&trace, *(const D3DXVECTOR3* const)&(pm->ps.origin), *(const D3DXVECTOR3* const)&(end), *(const D3DXVECTOR3* const)&(pm->ps.velocity), 0, pml.traceObj);
newtrace(&trace, pm->ps.origin, end, halfExtents, Ogre::Math::DegreesToRadians (pm->ps.viewangles.y), pm->isInterior, pm->mEngine); newtrace(&trace, pm->ps.origin, end, halfExtents, Ogre::Math::DegreesToRadians (pm->ps.viewangles.y), pm->isInterior, pm->mEngine);
@ -277,7 +277,7 @@ bool PM_SlideMove( bool gravity )
{ {
// pm->ps->velocity += (trace.plane.normal + pm->ps->velocity) // pm->ps->velocity += (trace.plane.normal + pm->ps->velocity)
//VectorAdd( trace.plane.normal, pm->ps->velocity, pm->ps->velocity ); //VectorAdd( trace.plane.normal, pm->ps->velocity, pm->ps->velocity );
pm->ps.velocity = (trace.planenormal + pm->ps.velocity); pm->ps.velocity = trace.planenormal + pm->ps.velocity;
break; break;
} }
} }
@ -330,7 +330,7 @@ bool PM_SlideMove( bool gravity )
if (clipVelocity.dotProduct(planes[i]) >= 0) if (clipVelocity.dotProduct(planes[i]) >= 0)
//if ( DotProduct( clipVelocity, planes[i] ) >= 0 ) //if ( DotProduct( clipVelocity, planes[i] ) >= 0 )
continue; continue;
// slide the original velocity along the crease // slide the original velocity along the crease
//dProduct (planes[i], planes[j], dir); //dProduct (planes[i], planes[j], dir);
@ -363,6 +363,7 @@ bool PM_SlideMove( bool gravity )
// see if there is a third plane the the new move enters // see if there is a third plane the the new move enters
for ( k = 0 ; k < numplanes ; k++ ) for ( k = 0 ; k < numplanes ; k++ )
{ {
if ( k == i || k == j ) if ( k == i || k == j )
continue; continue;
@ -1460,6 +1461,7 @@ static void PM_GroundTrace( void )
// slopes that are too steep will not be considered onground // slopes that are too steep will not be considered onground
//if ( trace.plane.normal[2] < MIN_WALK_NORMAL ) //if ( trace.plane.normal[2] < MIN_WALK_NORMAL )
//std::cout << "MinWalkNormal" << trace.planenormal.z;
if (trace.planenormal.z < MIN_WALK_NORMAL) if (trace.planenormal.z < MIN_WALK_NORMAL)
{ {
//if ( pm->debugLevel ) //if ( pm->debugLevel )

View File

@ -41,7 +41,7 @@ static const Ogre::Vector3 halfExtents(14.64f * 2, 14.24f * 2, 33.25f * 2);
#define MAX_GENTITIES (1 << GENTITYNUM_BITS) #define MAX_GENTITIES (1 << GENTITYNUM_BITS)
#define ENTITYNUM_NONE (MAX_GENTITIES - 1) #define ENTITYNUM_NONE (MAX_GENTITIES - 1)
#define ENTITYNUM_WORLD (MAX_GENTITIES - 2) #define ENTITYNUM_WORLD (MAX_GENTITIES - 2)
#define MIN_WALK_NORMAL 0.7f // can't walk on very steep slopes #define MIN_WALK_NORMAL .7f // can't walk on very steep slopes
#define JUMP_VELOCITY (270) #define JUMP_VELOCITY (270)
#define PS_PMOVEFRAMECOUNTBITS 6 #define PS_PMOVEFRAMECOUNTBITS 6
#define MINS_Z -24 #define MINS_Z -24
@ -90,7 +90,7 @@ struct playerMove
{ {
struct playerStruct struct playerStruct
{ {
playerStruct() : gravity(800.0f), speed(480.0f), pmove_framecount(20), groundEntityNum(ENTITYNUM_NONE), commandTime(40), move_type(PM_NOCLIP), pm_time(0), snappingImplemented(true), bSnap(false), counter(-1) playerStruct() : gravity(800.0f), speed(500.0f), pmove_framecount(20), groundEntityNum(ENTITYNUM_NONE), commandTime(40), move_type(PM_NOCLIP), pm_time(0), snappingImplemented(true), bSnap(false), counter(-1)
{ {
origin = Ogre::Vector3(733.164f,900.0f, 839.432f); origin = Ogre::Vector3(733.164f,900.0f, 839.432f);
velocity = Ogre::Vector3(0.0f, 0.0f, 0.0f); velocity = Ogre::Vector3(0.0f, 0.0f, 0.0f);