Better boat handling
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "GameData.h"
|
||||
#include "Components.h"
|
||||
#include "EventTriggerModule.h"
|
||||
#include "PhysicsModule.h"
|
||||
#include "physics.h"
|
||||
#include "loader.h"
|
||||
|
||||
@@ -1868,15 +1869,23 @@ void SceneLoader::setupPhysicsBody(Ogre::SceneNode *node,
|
||||
layer = Layers::NON_MOVING;
|
||||
mass = 0.0f;
|
||||
}
|
||||
#if 1
|
||||
JPH::ShapeRefC com_shape =
|
||||
JoltPhysicsWrapper::getSingleton()
|
||||
.createOffsetCenterOfMassShape(
|
||||
Ogre::Vector3(0, -5.5f, 0.5f),
|
||||
Ogre::Vector3(0, 0, 0.45f),
|
||||
shape);
|
||||
JPH::BodyID id =
|
||||
JoltPhysicsWrapper::getSingleton().createBody(
|
||||
com_shape.GetPtr(), mass, pNode, motion,
|
||||
layer);
|
||||
JoltPhysicsWrapper::getSingleton().setFriction(id, 0.95f);
|
||||
#else
|
||||
JPH::BodyID id =
|
||||
JoltPhysicsWrapper::getSingleton().createBody(
|
||||
shape.GetPtr(), mass, pNode, motion,
|
||||
layer);
|
||||
#endif
|
||||
LogManager::getSingleton().logMessage(
|
||||
"[SceneLoader] Node: " + pNode->getName() +
|
||||
" btRigidBody created: " + collisionBodyType);
|
||||
@@ -1887,6 +1896,7 @@ void SceneLoader::setupPhysicsBody(Ogre::SceneNode *node,
|
||||
id);
|
||||
/* do not add body to physics yet */
|
||||
base_e.set<JPH::BodyID>(id);
|
||||
base_e.set<ECS::CachedMass>({mass});
|
||||
} else if (collisionBodyType == "ghost") {
|
||||
/* TODO: later */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user