mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Flag to disable pvd
This commit is contained in:
14
main.go
14
main.go
@ -20,15 +20,21 @@ func contactHandler(cph pgo.ContactPairHeader) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
const enablePvd = true
|
||||||
|
|
||||||
f := pgo.CreateFoundation()
|
f := pgo.CreateFoundation()
|
||||||
println("foundation:", f)
|
println("foundation:", f)
|
||||||
|
|
||||||
|
var pvd *pgo.Pvd
|
||||||
|
if enablePvd {
|
||||||
pvdTr := pgo.DefaultPvdSocketTransportCreate("127.0.0.1", 5425, 100000)
|
pvdTr := pgo.DefaultPvdSocketTransportCreate("127.0.0.1", 5425, 100000)
|
||||||
println("Pvd transport:", pvdTr)
|
println("Pvd transport:", pvdTr)
|
||||||
|
|
||||||
pvd := pgo.CreatePvd(f)
|
pvd = pgo.CreatePvd(f)
|
||||||
println("Pvd:", pvd)
|
println("Pvd:", pvd)
|
||||||
println("connected to PVD:", pvd.Connect(pvdTr, pgo.PvdInstrumentationFlag_eALL))
|
println("connected to PVD:", pvd.Connect(pvdTr, pgo.PvdInstrumentationFlag_eALL))
|
||||||
|
}
|
||||||
|
|
||||||
ts := pgo.NewTolerancesScale(1, 9.81)
|
ts := pgo.NewTolerancesScale(1, 9.81)
|
||||||
p := pgo.CreatePhysics(f, ts, false, pvd)
|
p := pgo.CreatePhysics(f, ts, false, pvd)
|
||||||
@ -42,6 +48,7 @@ func main() {
|
|||||||
scene := p.CreateScene(sd)
|
scene := p.CreateScene(sd)
|
||||||
println("Scene:", scene)
|
println("Scene:", scene)
|
||||||
|
|
||||||
|
if enablePvd {
|
||||||
scenePvdClient := scene.GetScenePvdClient()
|
scenePvdClient := scene.GetScenePvdClient()
|
||||||
println("ScenePvdClient:", scenePvdClient)
|
println("ScenePvdClient:", scenePvdClient)
|
||||||
|
|
||||||
@ -49,6 +56,7 @@ func main() {
|
|||||||
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_CONTACTS, true)
|
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_CONTACTS, true)
|
||||||
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_SCENEQUERIES, true)
|
scenePvdClient.SetScenePvdFlag(pgo.PvdSceneFlag_eTRANSMIT_SCENEQUERIES, true)
|
||||||
scenePvdClient.Release()
|
scenePvdClient.Release()
|
||||||
|
}
|
||||||
|
|
||||||
//Add plane
|
//Add plane
|
||||||
pMat := p.CreateMaterial(0.5, 0.5, 0.6)
|
pMat := p.CreateMaterial(0.5, 0.5, 0.6)
|
||||||
@ -149,8 +157,4 @@ func main() {
|
|||||||
// println("Press enter...")
|
// println("Press enter...")
|
||||||
// r.ReadBytes('\n')
|
// r.ReadBytes('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
// p.Release()
|
|
||||||
// pvd.Release()
|
|
||||||
// pvdTr.Release()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user