![]() |
#1
|
|||
|
|||
Collision problem: Balls fly through the wall
Hi,
I want create a billiard game inside a room. So I created a box in 3ds Max and set the viewpoint and the 15 balls into this box. This works very fine. Code:
court = viz.add('world.wrl') court.collideMesh() .... ball.collideNone() ballPhysicalShape = ball.collideBox() But now my problem: If I initiate the shoot, the balls fly across the room and always collide with the walls. This is okay! But if I shoot them faster or if I set the bounce value from 0.5 to 2, they just fly through the wall. I don't know what's the matter for this action. Can anybody help me? Thanks a lot. Christina |
#3
|
|||
|
|||
Hey Moh200jo,
thanks for your answer, but I don't think this is my problem. Look at the demo physics2.py: You can shoot balls against the boxes. The MIN_POWER is 1 and for example the MAX_POWER is 80. This works all right. But if you change the MAX_POWER to 8000 you can see, that it will be possible to shoot the ball against the boxes, but they never collide. The ball ist too fast and will fly through the wall, without colliding. The duckcourt.py has the same problem: If you change the BALL_SPEED from 5 to 500 and shoot a ball, you can see that the ball never collide with the ducks. And exactly this is my problem. If I shoot the first ball too fast against the other balls, they collide and fly across the room. And because of their speed, they never collide with the walls. Hope anybody can help me.... |
#4
|
|||
|
|||
HI
Oh, I believe collision at vizard runs like this. I correct you have to play in your code to decrease the ball speed at exact distance between them. If you got something easier please let me know because I have this issue. |
#5
|
|||
|
|||
Hi Moh200jo,
sorry but I didn't get this. I ought to decrease the ball speed at which value? The distance between whom? Thanks in advance! |
#6
|
|||
|
|||
well, just for any speed would be worked with your collision. the distance I have talked about which is between ball and wall (ROOM).
Hope this will help you. |
#7
|
|||
|
|||
Make the walls of your box bigger.
__________________
Paul Elliott WorldViz LLC |
#8
|
|||
|
|||
Bigger as in thicker.
__________________
Paul Elliott WorldViz LLC |
#9
|
|||
|
|||
Hi Paul,
I do not understand how this would does the collision; could you please provide me an example of this? thanks |
#10
|
|||
|
|||
Each frame, the physics engine updates the position of the balls, then checks if the balls are touching other solid stuff. If the balls move so fast that they are on the other side of a wall, free and clear, then no collision is detected.
A thicker wall makes is more likely the ball is within the wall, a collision is detected, and the balls stay in the box. Should fix things, but the physics system can be kind of crazy.
__________________
Paul Elliott WorldViz LLC |
#11
|
|||
|
|||
Ah okay. Thank you for this information.
I'll make the walls thicker and will have a look what happens. |
#12
|
|||
|
|||
could you please post an example on this issue?
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PPT causing height problem | just alex | Precision Position Tracker (PPT) | 2 | 01-30-2009 09:50 AM |
Collision with child nodes | rubberpimple | Vizard | 4 | 09-17-2008 04:27 PM |
picking problem... | k_iwan | Vizard | 2 | 07-27-2007 07:57 PM |
problem with collision detection | paulpars | Vizard | 6 | 06-09-2006 06:03 PM |
problem with female animations | vmonkey | Vizard | 1 | 10-07-2005 10:36 AM |