Added rigid bodys

This commit is contained in:
Dane Johnson
2021-01-24 22:55:36 -06:00
parent d51528dd0f
commit f27cf4bd88
8 changed files with 187 additions and 11 deletions

View File

@@ -46,6 +46,17 @@ function init()
)
couch.Node.GetRoot().children:Append(skybox:Instance())
local physics_ball_prefab = couch.Rigidbody()
local physics_ball_mesh = couch.Mesh.FromFile("ball.obj")
material = physics_ball_mesh:GetMaterial(0)
material.ambient = BLUE
material.diffuse = BLUE
physics_ball_mesh:SetMaterial(0, material)
physics_ball_prefab.children:Append(physics_ball_mesh);
physics_ball_prefab.transform.position = couch.Vector3(0.0, 30.0, -10.0)
local physics_ball = physics_ball_prefab:Instance()
couch.Node.GetRoot().children:Append(physics_ball)
make_ground()
local cube_prefab = couch.Mesh.FromFile("cube.obj")