feat: major engine overhaul - scene demo with lighting, sphere, ground
- Scene Demo: cube + sphere + ground plane with proper lighting - Audio: XAudio2 dynamic loading + WAV playback - Physics: expanded collision system - Renderer: improved pipeline with materials - UI: extended widget system - VisualScript: enhanced serializer + block interactions - ASM: optimized math/memory/profiling routines - Window: mouse input + scroll support
This commit is contained in:
1 parent
2653926d85
commit
0669d102ce
35 files changed
+1844
-314
No files matched your search
@@ -16,6 +16,15 @@ typedef enum {
|
||||
COLLIDER_PLANE,
|
||||
} ColliderType;
|
||||
|
||||
typedef struct {
|
||||
Vec3 velocity;
|
||||
Vec3 acceleration;
|
||||
float mass;
|
||||
float restitution;
|
||||
float friction;
|
||||
int is_kinematic;
|
||||
} RigidBody;
|
||||
|
||||
typedef struct {
|
||||
uint32_t entity_id;
|
||||
ColliderType type;
|
||||
@@ -26,17 +35,9 @@ typedef struct {
|
||||
};
|
||||
int is_trigger;
|
||||
int is_static;
|
||||
RigidBody body;
|
||||
} Collider;
|
||||
|
||||
typedef struct {
|
||||
Vec3 velocity;
|
||||
Vec3 acceleration;
|
||||
float mass;
|
||||
float restitution;
|
||||
float friction;
|
||||
int is_kinematic;
|
||||
} RigidBody;
|
||||
|
||||
typedef struct {
|
||||
Collider colliders[MAX_COLLIDERS];
|
||||
uint32_t collider_count;
|
||||
@@ -63,6 +64,11 @@ int physics_check_collision(const Collider* a, const Collider* b, Vec3* normal,
|
||||
int physics_raycast(PhysicsWorld* world, Vec3 origin, Vec3 direction, float max_dist,
|
||||
uint32_t* hit_entity, Vec3* hit_point, Vec3* hit_normal);
|
||||
|
||||
// 刚体
|
||||
RigidBody* physics_get_body(PhysicsWorld* world, uint32_t index);
|
||||
void physics_apply_force(PhysicsWorld* world, uint32_t index, Vec3 force);
|
||||
void physics_apply_impulse(PhysicsWorld* world, uint32_t index, Vec3 impulse);
|
||||
|
||||
// 模拟
|
||||
void physics_step(PhysicsWorld* world, float dt);
|
||||
void physics_set_gravity(PhysicsWorld* world, Vec3 gravity);
|
||||
Reference in new issue
Block a user