mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added add force API endpoint
This commit is contained in:
@@ -24,6 +24,8 @@ class Scene {
|
||||
return Light.new(id)
|
||||
} else if (component == "CharacterController") {
|
||||
return CharacterController.new(id)
|
||||
} else if (component == "RigidBody") {
|
||||
return RigidBody.new(id)
|
||||
} else if (component == "Camera") {
|
||||
return Camera.new(id)
|
||||
} else if (component == "Transform") {
|
||||
@@ -70,6 +72,9 @@ class Scene {
|
||||
foreign static IsCharacterControllerOnGround_(e)
|
||||
//foreign static IsOnGround_(e)
|
||||
|
||||
// RigidBody
|
||||
foreign static AddForce_(e, x, y, z)
|
||||
|
||||
foreign static TriggerGetOverlappingBodyCount_(e)
|
||||
foreign static TriggerGetOverlappingBodies_(e)
|
||||
|
||||
@@ -159,6 +164,16 @@ class CharacterController {
|
||||
}
|
||||
}
|
||||
|
||||
class RigidBody {
|
||||
construct new(id) {
|
||||
_entityId = id
|
||||
}
|
||||
|
||||
AddForce(force) {
|
||||
Scene.AddForce_(_entityId, force.x, force,y, force.z)
|
||||
}
|
||||
}
|
||||
|
||||
class Camera {
|
||||
construct new(id) {
|
||||
_entityId = id
|
||||
|
||||
Reference in New Issue
Block a user