Skip to content

Commit

Permalink
comm update
Browse files Browse the repository at this point in the history
  • Loading branch information
cameni committed Oct 2, 2017
1 parent 331ed70 commit a196cd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/otbullet/discrete_dynamics_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,23 +314,22 @@ namespace ot {

get_obb(internal_obj_wrapper.getCollisionShape(), internal_obj_wrapper.getWorldTransform(), _from, _basis);

//if(!_sphere_intersect(_context, _from , _rad , _lod_dim, _triangles, _trees)) {
_relocation_offset = _tb_cache.get_array().ptr();
//_relocation_offset = _tb_cache.get_array().ptr();

bool is_above_tm = false;

if (!_aabb_intersect(_context, _from, _basis, _lod_dim, _triangles, _tree_batches, _tb_cache, frame_count,is_above_tm)) {
DASSERT(_tree_batches.size() == 0);
continue;
}

/*
if (_relocation_offset != _tb_cache.get_array().ptr()) {
coidlog_warning("discrete_dynamics_world", "Tree baches slot allocator rebased. Tree batches count: " << _tb_cache.count());
repair_tree_batches();
repair_tree_collision_pairs();
}
}*/

tri_count += _triangles.size();
tri_count += uint(_triangles.size());

if (_triangles.size() > 0) {

Expand Down Expand Up @@ -549,7 +548,7 @@ namespace ot {
aabb_half[1] = dst_basis[1].dot(src_basis[0]) + dst_basis[0].dot(src_basis[1]) + dst_basis[0].dot(src_basis[2]);
aabb_half[2] = dst_basis[2].dot(src_basis[0]) + dst_basis[0].dot(src_basis[1]) + dst_basis[0].dot(src_basis[2]);
}

/*
void discrete_dynamics_world::repair_tree_collision_pairs()
{
_tree_collision_pairs.for_each([&](tree_collision_pair& tcp) {
Expand All @@ -572,7 +571,7 @@ namespace ot {
}
}
});
}
}*/

bt::tree_collision_info * discrete_dynamics_world::get_tree_collision_info(const tree_collision_pair& tcp)
{
Expand Down Expand Up @@ -667,7 +666,7 @@ namespace ot {
, _debug_terrain_triangles(1024)
, _debug_trees(1024)
, _tb_cache(1024)
, _relocation_offset(0)
//, _relocation_offset(0)
{
btTriangleShape * ts = new btTriangleShape();
ts->setMargin(0.0f);
Expand Down
2 changes: 1 addition & 1 deletion src/otbullet/discrete_dynamics_world.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class discrete_dynamics_world : public btDiscreteDynamicsWorld

coid::dynarray<bt::triangle> _triangles;
coid::slotalloc<bt::tree_batch> _tb_cache;
void * _relocation_offset;
//void * _relocation_offset;

coid::dynarray<uint> _tree_batches;

Expand Down

0 comments on commit a196cd4

Please sign in to comment.