03-12-2011, 06:34 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:they'll have to not collide with each other somehow
It is possible to disable collisions for linked(joints) objects and object groups(using bit masks). I don't think it is really needed in this case. Bullet can deal with stacking of objects quite well. I think I'll have to enable concave shapes and decompose them into convex parts creating a compound shape. Need to check if bullet can do this for me.
Another feature are joints. It would be cool to have objects breaking away on collision. Not sure how to expose them to the user yet.
A completely different approach would be to support .bullet files. This would allow to setup track physics directly in blender or maya with all the fancy features bullet has to offer, but also would make us dependent on this tools.
|
|
03-26-2011, 08:36 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Mesh: 162 verts
btConvexHullComputer: 34 verts
Manually: 10 verts
The latest convex hull generator in bullet is very impressive(selected vertices in the image). A user on the other side might be able to reduce vertex count even more as he doesn't have to follow the same constraints.
I've been thinking about replacing the shape by a hull and optionally box section. It would mean some more work for the artist but also a maximum of control. Multiple hulls/boxes would define a concave body.
Code: texture = trailer_red.png
model = trailer.joe
mass-center = 0.0, -4.5, 2.25
mass = 3000
[hull.0]
0 = -1.176580, -6.594260, 0.324940
1 = 1.183840, -9.965520, 0.324940
2 = -1.167250, -9.968500, 3.816870
3 = 1.183840, -9.965520, 3.816870
4 = -1.181360, 1.005980, 3.804560
5 = 1.169740, 1.009020, 3.804560
6 = 1.174410, -6.594260, 0.324990
7 = -1.167250, -9.968500, 0.324940
8 = 1.169720, 1.019910, 1.101590
9 = -1.181360, 1.019830, 1.101590
#[box.0]
#center =
#size =
(The hull vertex values are retrieved by exporting the mesh as hull.obj)
|
|
03-27-2011, 03:58 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Hull, box and compound shapes are in trunk. Try to get stuck below the trailer with the F1-02. I haven't had time to fully test it. If you run into issues report.
trackparts/vehicles/trucks/trailer:
Code: texture = trailer_red.png
model = trailer.joe
mass-center = 0.0, -4.5, 2.25
mass = 3000
[shape.box.container]
center = 0.0, -4.47, 2.45
size = 2.36, 10.98, 2.7
[shape.box.wheels]
center = 0.0, -8.02, 0.56
size = 2.36, 2.21, 1.1
[shape.box.gear]
center = 0.0, -1.85, 0.56
size = 1.38, 0.18, 1.1
#[shape.hull.trailer]
#0 = -1.176580, -6.594260, 0.324940
#1 = 1.183840, -9.965520, 0.324940
The box values have been retrieved using scaled cube shapes in blender. It should be possible to mix hulls with boxes (haven't tested it though).
Quote:would that be useful performance wise?
The performance depends on the number of vertices for hull and on the number of child shapes for the compound. They should be as few as possible. Box shapes should be always faster than hulls (haven't verified it).
I think I could use the same fracture code for compound track objects as for the cars to make them break (if I ever get to finish it).
|
|
|