mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
58
Engine/lib/bullet/data/terrain.py
Normal file
58
Engine/lib/bullet/data/terrain.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import math
|
||||
|
||||
NUM_VERTS_X = 30
|
||||
NUM_VERTS_Y = 30
|
||||
totalVerts = NUM_VERTS_X * NUM_VERTS_Y
|
||||
totalTriangles = 2 * (NUM_VERTS_X - 1) * (NUM_VERTS_Y - 1)
|
||||
offset = -50.0
|
||||
TRIANGLE_SIZE = 1.
|
||||
waveheight = 0.1
|
||||
gGroundVertices = [None] * totalVerts * 3
|
||||
gGroundIndices = [None] * totalTriangles * 3
|
||||
|
||||
i = 0
|
||||
|
||||
for i in range(NUM_VERTS_X):
|
||||
for j in range(NUM_VERTS_Y):
|
||||
gGroundVertices[(i + j * NUM_VERTS_X) * 3 + 0] = (i - NUM_VERTS_X * 0.5) * TRIANGLE_SIZE
|
||||
gGroundVertices[(i + j * NUM_VERTS_X) * 3 + 1] = (j - NUM_VERTS_Y * 0.5) * TRIANGLE_SIZE
|
||||
gGroundVertices[(i + j * NUM_VERTS_X) * 3 +
|
||||
2] = waveheight * math.sin(float(i)) * math.cos(float(j) + offset)
|
||||
|
||||
index = 0
|
||||
for i in range(NUM_VERTS_X - 1):
|
||||
for j in range(NUM_VERTS_Y - 1):
|
||||
gGroundIndices[index] = 1 + j * NUM_VERTS_X + i
|
||||
index += 1
|
||||
gGroundIndices[index] = 1 + j * NUM_VERTS_X + i + 1
|
||||
index += 1
|
||||
gGroundIndices[index] = 1 + (j + 1) * NUM_VERTS_X + i + 1
|
||||
index += 1
|
||||
gGroundIndices[index] = 1 + j * NUM_VERTS_X + i
|
||||
index += 1
|
||||
gGroundIndices[index] = 1 + (j + 1) * NUM_VERTS_X + i + 1
|
||||
index += 1
|
||||
gGroundIndices[index] = 1 + (j + 1) * NUM_VERTS_X + i
|
||||
index += 1
|
||||
|
||||
#print(gGroundVertices)
|
||||
#print(gGroundIndices)
|
||||
|
||||
print("o Terrain")
|
||||
|
||||
for i in range(totalVerts):
|
||||
print("v "),
|
||||
print(gGroundVertices[i * 3 + 0]),
|
||||
print(" "),
|
||||
print(gGroundVertices[i * 3 + 1]),
|
||||
print(" "),
|
||||
print(gGroundVertices[i * 3 + 2])
|
||||
|
||||
for i in range(totalTriangles):
|
||||
print("f "),
|
||||
print(gGroundIndices[i * 3 + 0]),
|
||||
print(" "),
|
||||
print(gGroundIndices[i * 3 + 1]),
|
||||
print(" "),
|
||||
print(gGroundIndices[i * 3 + 2]),
|
||||
print(" ")
|
||||
Loading…
Add table
Add a link
Reference in a new issue