njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Loading...
Searching...
No Matches
njin::model3d Struct Tham chiếu

Component: một model vẽ tại njin::transform3d của entity, trong mọi lần vẽ 3D có camera3d::entities (engine thêm nó ở end_3d(), cùng các lệnh vẽ của game). Tiếp...

#include <njin_3d.h>

Các thuộc tính Public

model_handle model {}
 Model từ model_load().
rgba tint {1.0f, 1.0f, 1.0f, 1.0f}
 Màu nhân vào màu của model.
model_pose pose {}
 Tư thế, như draw_model_anim().
f32 speed = 1.0f
 Tốc độ chạy animation. 0 là dừng.
fx3d fx {}
 Nháy màu và tan biến, như fx3d_set().
bool visible = true
 Ẩn mà không cần gỡ component.

Mô tả chi tiết

Component: một model vẽ tại njin::transform3d của entity, trong mọi lần vẽ 3D có camera3d::entities (engine thêm nó ở end_3d(), cùng các lệnh vẽ của game).

Engine tăng pose.time và pose.blend_time mỗi frame (theo delta(), nhân speed), nên game chỉ cần chọn animation:

const auto e = reg.create();
reg.emplace<njin::transform3d>(e, njin::transform3d{.position = {0, 0, -4}});
reg.emplace<njin::model3d>(e, njin::model3d{.model = robot, .pose = {.anim = walk}});
Component: một model vẽ tại njin::transform3d của entity, trong mọi lần vẽ 3D có camera3d::entities (...
Definition njin_3d.h:1085
Vị trí, hướng và tỉ lệ của một vật 3D.
Definition njin_3d.h:504