Terrain shape stubs
This commit is contained in:
@@ -147,6 +147,7 @@ function tab_object_draw(htab: ui_handle_t) {
|
||||
tr("Box"),
|
||||
tr("Sphere"),
|
||||
tr("Convex Hull"),
|
||||
tr("Terrain"),
|
||||
tr("Mesh"),
|
||||
];
|
||||
hshape.position = pb != null ? pb.shape + 1 : 0;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <Jolt/Physics/Collision/Shape/SphereShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/MeshShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/ConvexHullShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/HeightFieldShape.h>
|
||||
#include <Jolt/Physics/Body/BodyCreationSettings.h>
|
||||
#include <Jolt/Physics/Body/MotionQuality.h>
|
||||
#include <kinc/math/vector.h>
|
||||
@@ -117,7 +118,8 @@ typedef enum {
|
||||
physics_shape_BOX = 0,
|
||||
physics_shape_SPHERE = 1,
|
||||
physics_shape_HULL = 2,
|
||||
physics_shape_MESH = 3,
|
||||
physics_shape_TERRAIN = 3,
|
||||
physics_shape_MESH = 4,
|
||||
} physics_shape_t;
|
||||
|
||||
BPLayerInterfaceImpl broad_phase_layer_interface;
|
||||
@@ -211,6 +213,13 @@ void *_jolt_body_create(int shape, float mass, float dimx, float dimy, float dim
|
||||
shape_settings.SetEmbedded();
|
||||
result = shape_settings.Create();
|
||||
}
|
||||
else if (shape == physics_shape_TERRAIN) {
|
||||
f32_array_t *f32a = (f32_array_t *)f32a_triangles;
|
||||
|
||||
// HeightFieldShapeSettings shape_settings();
|
||||
// shape_settings.SetEmbedded();
|
||||
// result = shape_settings.Create();
|
||||
}
|
||||
else {
|
||||
// Mesh
|
||||
f32_array_t *f32a = (f32_array_t *)f32a_triangles;
|
||||
|
||||
@@ -24,7 +24,8 @@ enum physics_shape_t {
|
||||
BOX = 0,
|
||||
SPHERE = 1,
|
||||
HULL = 2,
|
||||
MESH = 3,
|
||||
TERRAIN = 3,
|
||||
MESH = 4,
|
||||
}
|
||||
|
||||
let physics_body_object_map: map_t<i32, physics_body_t> = map_create();
|
||||
@@ -45,7 +46,8 @@ function physics_body_init(body: physics_body_t, obj: object_t) {
|
||||
|
||||
let triangles: f32[] = null;
|
||||
if (body.shape == physics_shape_t.MESH ||
|
||||
body.shape == physics_shape_t.HULL
|
||||
body.shape == physics_shape_t.HULL ||
|
||||
body.shape == physics_shape_t.TERRAIN
|
||||
) {
|
||||
let mo: mesh_object_t = obj.ext;
|
||||
let data: mesh_data_t = mo.data;
|
||||
|
||||
Reference in New Issue
Block a user