mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Simulate and fetch results
This commit is contained in:
8
main.go
8
main.go
@ -33,8 +33,14 @@ func main() {
|
||||
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_CONTACTS, true)
|
||||
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_SCENEQUERIES, true)
|
||||
|
||||
for {
|
||||
pMat := p.CreateMaterial(0.5, 0.5, 0.6)
|
||||
groundPlane := pgo.CreatePlane(p, pgo.NewPlane(0, 1, 0, 1), pMat)
|
||||
s.AddActor(groundPlane.ToActor())
|
||||
|
||||
for {
|
||||
s.Simulate(1 / 60.0)
|
||||
a, b := s.FetchResults(true)
|
||||
println("a:", a, "; b:", b)
|
||||
}
|
||||
|
||||
p.Release()
|
||||
|
||||
Reference in New Issue
Block a user