Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-12 14:26:09 +0000
committerStijn Buys <ingar@osirion.org>2011-07-12 14:26:09 +0000
commit8c3abbb3c04c6119b8f0ceb546c3aff66703ba14 (patch)
tree975ff9f73ef7841763111a0e0dc7065e34e3cbf7 /src/core/entity.cc
parentbbbd41ccf4e7501e93689afecab442cb7e60a5de (diff)
Removed Entity::Complex flag: collision models will be used if availble,
removed a number of irrelevant comments.
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 84f4de0..da94896 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -550,7 +550,7 @@ void Entity::reset()
if (model() && model()->radius()) {
const float modelscale = radius() / model()->radius();
- if (flag_is_set(Complex) && model()->collisionmodel() && model()->collisionmodel()->size()) {
+ if (model()->collisionmodel() && model()->collisionmodel()->size()) {
// complex collision is enabled and a valid collision model has been found
btCompoundShape *compoundshape = new btCompoundShape();
@@ -571,7 +571,8 @@ void Entity::reset()
meshshape->buildOptimizedBvh();
meshshape->recalcLocalAabb();
- // apply collision mesh properties to the btCollisionShape
+ // apply collision mesh properties to the btCollisionShape
+ // FIXME this goes wrong with rotated entities (see alexandria)
btTransform child_transform;
child_transform.setIdentity();
child_transform.setOrigin(to_btVector3(mesh->location() * modelscale));
@@ -681,7 +682,7 @@ void EntityDynamic::reset()
if (model() && model()->radius()) {
const float modelscale = radius() / model()->radius();
- if (flag_is_set(Complex) && model()->collisionmodel() && model()->collisionmodel()->size()) {
+ if (model()->collisionmodel() && model()->collisionmodel()->size()) {
// complex collision is enabled and a valid collision model has been found
btCompoundShape *compoundshape = new btCompoundShape();
for (model::CollisionModel::CollisionMeshes::iterator it = model()->collisionmodel()->meshes().begin();
@@ -1143,8 +1144,8 @@ void EntityControlable::reset()
if (model() && model()->radius()) {
const float modelscale = radius() / model()->radius();
- if (flag_is_set(Complex) && model()->collisionmodel() && model()->collisionmodel()->size()) {
- // complex collision is enabled and a valid collision model has been found
+ if (model()->collisionmodel() && model()->collisionmodel()->size()) {
+ // a valid collision model has been found
btCompoundShape *compoundshape = new btCompoundShape();
for (model::CollisionModel::CollisionMeshes::iterator it = model()->collisionmodel()->meshes().begin();
it != model()->collisionmodel()->meshes().end(); it++) {