Please, need help

Hello, dear people of this forum.

Sorry for bad English, because I still do not know your language, I communicate with you through an interpreter. (Thanks for understanding)

I am still very bad sort and Panda3d and python, and I very much need your help.

I have to ask you, could you show the code with a working physicist. Ie a box falls ае a plane (the ground).

Thanks in advance for help :slight_smile: … n_with_ODE

Of course thanks to you, dear, but before opening the topic, I looked through all the manuals, which you gave me links. I would like to consider the standard physics + collision (not ode), and to see a small, fully working code, preferably with the comments that I finally grasped how to operate the standard physics.

I very much suggest you using ODE for everything that goes further than zone triggers.

It may sound easier to use built-in physics, but we (a buddy and me) had a hard time understanding Panda’s ideas behind the ActorNode and the way Panda handles physics in general.
That said ODE was really quite intuitive and simple to use. (Though I must admit, I haven’t used ODE for collisions yet, only for physical calculations.)

Long story short: try out ODE.
I doubt you’ll regret that choice.


Thank you persuaded me, but I have a new problem.
I wrote the code, based on the code this in the manual, the code runs without error, but runtime error ,, help please, can I do something wrong? Thank you for your attention and help!

from direct.directbase import DirectStart
from pandac.PandaModules import OdeWorld, OdeSimpleSpace, OdeJointGroup
from pandac.PandaModules import OdeBody, OdeMass, OdeTriMeshData, OdeTriMeshGeom
from pandac.PandaModules import BitMask32, CardMaker, Vec4, Quat
from random import randint, random
# Setup our physics world
world = OdeWorld()
world.setGravity(0, 0, -9.81)
# The surface table is needed for autoCollide
world.setSurfaceEntry(0, 0, 900, 0.0, 9.1, 0.9, 0.00001, 0.0, 0.002)
# Create a space and add a contactgroup to it to add the contact joints
space = OdeSimpleSpace()
contactgroup = OdeJointGroup()

do = loader.loadModel("do")

land = loader.loadModel("land")

doBody = OdeBody(world)
M = OdeMass()

doTrimesh = OdeTriMeshData(do, True)
doCol = OdeTriMeshGeom(space, doTrimesh)

landTrimesh = OdeTriMeshData(land, True)
landCol = OdeTriMeshGeom(space, landTrimesh)

# Set the camera position

def simTask(task):
	do.setPosQuat(render, doBody.getPosition(), Quat(doBody.getQuaternion()))
	contactgroup.empty() # Clear the contact joints
  	return task.cont

taskMgr.doMethodLater(0.5, simTask, "Physics Simulation")


Excuse me for getting off topic, but based on the image hosting site you used, I guessed you know russian so you might have a look at the russian forums: