mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
38 lines
737 B
Go
Executable File
38 lines
737 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"github.com/bloeys/physx-go/pgo"
|
|
)
|
|
|
|
func main() {
|
|
f := pgo.CreateFoundation()
|
|
defer f.Release()
|
|
println("foundation:", f)
|
|
|
|
pvdTr := pgo.DefaultPvdSocketTransportCreate("0.0.0.0", 5426, 100000)
|
|
println("Pvd transport:", pvdTr)
|
|
|
|
pvd := pgo.CreatePvd(f)
|
|
println("Pvd:", pvd)
|
|
println("connect:", pvd.Connect(pvdTr, pgo.PvdInstrumentationFlag_eALL))
|
|
|
|
ts := pgo.NewTolerancesScale(1, 9.81)
|
|
p := pgo.CreatePhysics(f, ts, false, pvd)
|
|
println("Physics:", p)
|
|
|
|
sd := pgo.NewSceneDesc(ts)
|
|
sd.SetGravity(pgo.NewVec3(0, -9.8, 0))
|
|
sd.SetCpuDispatcher(pgo.DefaultCpuDispatcherCreate(2, 0).ToCpuDispatcher())
|
|
|
|
s := p.CreateScene(sd)
|
|
println("Scene:", s)
|
|
|
|
for {
|
|
|
|
}
|
|
|
|
p.Release()
|
|
pvd.Release()
|
|
pvdTr.Release()
|
|
}
|