Search found 73 matches

by hyyou
Tue Feb 13, 2018 6:38 am
Forum: General Bullet Physics Support and Feedback
Topic: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)
Replies: 8
Views: 370

Re: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)

Hmm.... I also tried to use it a few years ago but failed .... so I always assume that Ghost-and-friend are quite useless. :lol: Unfortunately, I have a lot of objects in the world (100-1000). My ultimate objective is to simulate a compound shape with radar :- bullet15.jpg However, Bullet doesn't su...
by hyyou
Sun Feb 11, 2018 8:52 am
Forum: General Bullet Physics Support and Feedback
Topic: Jbullet: NPE when removing body with TRIANGLE_MESH shape.
Replies: 3
Views: 1942

Re: Jbullet: NPE when removing body with TRIANGLE_MESH shape.

Should a rigid body always be re-added to the world after setting the collision shape I don't know about Java port, but this is a well-known Bullet (C++) limitation/restriction of usage. A workaround is to encapsulate it. I check change-of-shape every time-step. Reference (C++) : https://pybullet.o...
by hyyou
Sun Feb 11, 2018 3:08 am
Forum: General Bullet Physics Support and Feedback
Topic: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)
Replies: 8
Views: 370

Re: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)

Wow! A complete code. Thank drleviathan, again XD. For science, I took the liberty of running your code, and post the result :- bullet14.jpg There are 2 aspects that worry me :- - At 002, it shows "bug?". - If stepSimulation() is removed, numOverlaps at 001 will = 0 (more wrong). My objective of usi...
by hyyou
Sat Feb 10, 2018 6:49 am
Forum: General Bullet Physics Support and Feedback
Topic: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)
Replies: 8
Views: 370

Re: How to performDiscreteCollisionDetection (update manifold) for only a few bodies?

I have just tried the ghost body. My test case has only 2 bodies in the world. Body1 is normal body, and Body2 is ghost. When t=0, both objects are at (0,0,0). When t=1, Body2 move to (3,0,0). When t=2, Body2 move back to (0,0,0). bullet13.jpg I want to detect manifold at t=0 and t=2. However, every...
by hyyou
Wed Jan 24, 2018 11:29 am
Forum: General Bullet Physics Support and Feedback
Topic: Better way to implement a character controller?
Replies: 3
Views: 756

Re: Better way to implement a character controller?

I am another one that hate ray-cast for foot-test. Adding another "foot" btRigidBody as sensor works for me. http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Callbacks_and_Triggers#Triggers I didn't claim that the sensor approach is better, though. If you are interested, please see r...
by hyyou
Thu Jan 18, 2018 8:51 am
Forum: General Bullet Physics Support and Feedback
Topic: Networked physics? (idtech3)
Replies: 2
Views: 209

Re: Networked physics? (idtech3)

(I have never used idtech3 before.) To answer "Would it be too slow ..." ... How many objects/constraint in your world? How complex is the map? It also depends on many customize-able setting e.g. friction, restitution, time-resolution ... Generally, 24 dynamic bodies are far from "too many". IMHO, B...
by hyyou
Wed Jan 17, 2018 1:53 am
Forum: General Bullet Physics Support and Feedback
Topic: Coordinate Space Conversions? Are there any?
Replies: 4
Views: 231

Re: Coordinate Space Conversions? Are there any?

If I remember correctly, there is an official tutorial at FractureDemo> btFractureBody.cpp in the repository.
by hyyou
Mon Jan 15, 2018 2:05 am
Forum: General Bullet Physics Support and Feedback
Topic: Coordinate Space Conversions? Are there any?
Replies: 4
Views: 231

Re: Coordinate Space Conversions? Are there any?

Just want to add some little things to drleviathan's great answer :- the inertia's eigenvectors align with the cardinal axes of the shape's local-frame ^ btMatrix3x3::diagonalized() will help about this. In fact, this is the only way to have a concave RigidBody that is dynamic or kinematic. There ar...
by hyyou
Mon Jan 08, 2018 5:04 am
Forum: General Bullet Physics Support and Feedback
Topic: Getting from Rigidbody to GameObject (architecture question)
Replies: 1
Views: 176

Re: Getting from Rigidbody to GameObject (architecture question)

Yes, it supports.
See btCollisionObject::setUserPointer(void*) / getUserPointer.
by hyyou
Thu Jan 04, 2018 2:02 am
Forum: General Bullet Physics Support and Feedback
Topic: Custom broadphase filter for city-sized world, need advice
Replies: 4
Views: 325

Re: Custom broadphase filter for city-sized world, need advice

+1 drleviathan :lol: I heard a rumor that btAxisSweep3 and bt32AxisSweep3 is faster than the generic one "with a limitation that it requires a fixed world size". It is in Sweep and Prune (SAP) in http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Broadphase ^Edit: Erwin doesn't think so. Thus, p...
by hyyou
Thu Dec 28, 2017 3:09 am
Forum: General Bullet Physics Support and Feedback
Topic: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)
Replies: 8
Views: 370

Re: How to performDiscreteCollisionDetection (update manifold) for only a few bodies?

Thank drleviathan for the great detailed answer.
btPairCachingGhostObject is probably all I want (the 10-20 objects are all radar/sensor). I have never used ghost thingy before.

off-topic : It is lucky that this forum has you. :D
by hyyou
Wed Dec 27, 2017 2:18 am
Forum: General Bullet Physics Support and Feedback
Topic: performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)
Replies: 8
Views: 370

performDiscreteCollisionDetection (update manifold) for only a few bodies (ghost?)

I have a loop like :- btDiscreteDynamicsWorld_instance->stepSimulation(......); //has 1000 bodies (20% CPU) add / change position of 10-20 btRigidbody; btDiscreteDynamicsWorld_instance->performDiscreteCollisionDetection(); //<-- slow (10% CPU) iterating btPersistentManifold for collision callback; T...
by hyyou
Tue Nov 21, 2017 12:38 pm
Forum: General Bullet Physics Support and Feedback
Topic: Get linear velocity at non-central point on a rigid body?
Replies: 2
Views: 634

Re: Get linear velocity at non-central point on a rigid body

I totally encapsulated Bullet, and coded such functions myself.
It is not convenient, but it works.

getVelocity_relativeToCM_worldAxis(Vector3 positionRelativeToCM);
getVelocity_relativeToCM_shapeAxis(Vector3 positionRelativeToCM);
getVelocity_absolutePosition_worldAxis(Vector3 worldPosition);
by hyyou
Mon Nov 06, 2017 10:05 am
Forum: PyBullet Support and Feedback
Topic: Questions about pybullet use in videogame
Replies: 4
Views: 741

Re: Questions about pybullet use in videogame

Because no one answer ...

I am pretty sure that C++ Bullet is faster than its derivatives.

In practice, especially game, C++ itself is generally faster than python.
It is a reason that I lack knowledge to answer most of your questions.