Changeset 1782 for trunk/test/Physics/Include
- Timestamp:
- Aug 20, 2012, 11:21:01 PM (10 years ago)
- Location:
- trunk/test/Physics/Include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/Physics/Include/EasyCharacterController.h
r1768 r1782 11 11 12 12 // 13 // The Easy Physicclass13 // The EasyCharacterController class 14 14 // ------------------ 15 // 16 17 //Should try to to make a btKinematicCharacterController for real. 15 18 // 16 19 … … 34 37 { 35 38 39 friend class Simulation; 40 friend class EasyPhysic; 41 36 42 #ifdef HAVE_PHYS_USE_BULLET 37 43 … … 48 54 m_gamegroup = GAMEGROUP_EZP_CHAR_CTRLR; 49 55 m_up_axis = 1; 56 m_gravity = vec3(.0f, -9.81f, .0f); 50 57 } 51 58 ~EasyCharacterController() … … 78 85 vec3 m_base_cached_movement; 79 86 vec3 m_frame_cached_movement; 87 vec3 m_gravity; 88 vec3 m_velocity; 80 89 81 90 #else // NO PHYSIC IMPLEMENTATION -
trunk/test/Physics/Include/EasyConstraint.h
r1749 r1782 31 31 class EasyConstraint 32 32 { 33 34 friend class Simulation; 35 friend class EasyPhysic; 36 33 37 #ifdef HAVE_PHYS_USE_BULLET 34 38 … … 41 45 m_cone_twist_constraint(NULL), 42 46 m_6dof_constraint(NULL), 47 m_owner_simulation(NULL), 43 48 m_a_physobj(NULL), 44 49 m_b_physobj(NULL), … … 194 199 195 200 private: 201 Simulation* m_owner_simulation; 196 202 EasyPhysic* m_a_physobj; 197 203 EasyPhysic* m_b_physobj; -
trunk/test/Physics/Include/EasyPhysics.h
r1768 r1782 34 34 { 35 35 36 friend class Simulation; 36 37 friend class EasyConstraint; 37 friend class Simulation;38 38 39 39 #ifdef HAVE_PHYS_USE_BULLET … … 154 154 int m_collision_mask; 155 155 WorldEntity* m_owner_entity; 156 Simulation* m_owner_simulation; 156 157 157 158 //Base/Attachment logic -
trunk/test/Physics/Include/LolPhysics.h
r1768 r1782 321 321 322 322 private: 323 323 324 friend class EasyPhysic; 325 friend class EasyCharacterController; 324 326 friend class EasyConstraint; 325 327 328 enum eEasyPhysicType 329 { 330 EEPT_Dynamic, 331 EEPT_Static, 332 EEPT_Ghost, 333 EEPT_CollisionObject, 334 EEPT_CharacterController, 335 336 EEPT_MAX 337 }; 338 339 //m_owner_simulation 326 340 //Adds the given EasyPhysic to the correct list. 327 void AddToDynamic(EasyPhysic* NewEPDynamic) { m_dynamic_list << NewEPDynamic; } 328 void AddToStatic(EasyPhysic* NewEPStatic) { m_static_list << NewEPStatic; } 329 void AddToGhost(EasyPhysic* NewEPGhost) { m_ghost_list << NewEPGhost; } 330 void AddToConstraint(EasyConstraint* NewEC) { m_constraint_list << NewEC; } 341 void ObjectRegistration(bool AddObject, EasyPhysic* NewEP, eEasyPhysicType CurType) 342 { 343 Array<EasyPhysic*>* SearchList = NULL; 344 switch(CurType) 345 { 346 case EEPT_Dynamic: 347 { 348 SearchList = &m_dynamic_list; 349 break; 350 } 351 case EEPT_Static: 352 { 353 SearchList = &m_static_list; 354 break; 355 } 356 case EEPT_Ghost: 357 { 358 SearchList = &m_ghost_list; 359 break; 360 } 361 case EEPT_CollisionObject: 362 { 363 SearchList = &m_collision_object_list; 364 break; 365 } 366 case EEPT_CharacterController: 367 { 368 SearchList = &m_character_controller_list; 369 break; 370 } 371 } 372 373 if (AddObject) 374 { 375 NewEP->m_owner_simulation = this; 376 (*SearchList) << NewEP; 377 } 378 else 379 { 380 NewEP->m_owner_simulation = NULL; 381 for (int i = 0; i < SearchList->Count(); ++i) 382 { 383 if ((*SearchList)[i] == NewEP) 384 { 385 SearchList->Remove(i--); 386 break; 387 } 388 } 389 } 390 } 391 void ObjectRegistration(bool AddObject, EasyConstraint* NewEC) 392 { 393 Array<EasyConstraint*>* SearchList = NULL; 394 SearchList = &m_constraint_list; 395 396 if (AddObject) 397 { 398 NewEC->m_owner_simulation = this; 399 (*SearchList) << NewEC; 400 } 401 else 402 { 403 NewEC->m_owner_simulation = NULL; 404 for (int i = 0; i < SearchList->Count(); ++i) 405 { 406 if ((*SearchList)[i] == NewEC) 407 { 408 SearchList->Remove(i--); 409 break; 410 } 411 } 412 } 413 } 331 414 332 415 //Easy Physics body List … … 334 417 Array<EasyPhysic*> m_static_list; 335 418 Array<EasyPhysic*> m_ghost_list; 419 Array<EasyPhysic*> m_collision_object_list; 420 Array<EasyPhysic*> m_character_controller_list; 336 421 Array<EasyConstraint*> m_constraint_list; 337 422
Note: See TracChangeset
for help on using the changeset viewer.