strange error with collision code

Dear all,
i’m experiencing a very strange behaviour of panda3D .
I made a program to load a scene , and a character and i modified the roaming sample for the colision of my actor on my scene .
When i launch the program the first time it works . when i launch it a second time , i get an error :

Assertion Failed: _current_index + sizeof(tempvar) <= _datagram->get_length() at line 203 c:\p\panda3d-1.5.4\built\include\datagramIterator.I

this errors is flooding the console and nothing happend .

I found out that when i get rid of the collision information in my egg file and i restard my program , then i put the information back and restart my program , it works one more time but won’t work the time after .

i must have done something wrong . Has anybody ever had a similar problem ?

thanks for you help

maaks

hello

after some work around i made a minimal code that is still displaying this evil message:

import direct.directbase.DirectStart
from direct.showbase.DirectObject import DirectObject
class World(DirectObject):
	def __init__(self):
		self.bus = loader.loadModel("/c/gcp/redone/bus_X/bus")
		self.bus.reparentTo(render)
		self.bus.setScale(2,2,2)
		self.bus.setPos(0,0,2)
		
		
w = World()
run()

so it seams that the problem comes from either the egg file or the function that load the collision geometry from the egg file .

The egg file is directly exported from 3ds2009 with the right plugins
and modified by adding the line :

<Collide> { Polyset keep descend }

in the main group tag.

To resume the error .
First use after exportation , it works
Second to N use it display the error message

To make the code work again , i have to get rid of the collide tag in the egg file , lauch the code once ,
then put the collide tag back and the code will work once again (only once , if i launch it again i get the error message back flooding my output console)

it’s a really wierd behavior , i don’t see what could be different from a launch to another

any ideas where it might come from ?

ok the problem seems to come from the cached files stored in panda3D\modelcache\

Panda3D , store in it’s cache compiled egg files (.bam) and must be using those cached files if the .egg file it refers did not change .

So the error should come from the eggTobam converter , i’m going to try to compile my egg files into bam myself and see if i still get the error

yes it works with the egg file and gives error with the bam file.
I don’t really have time now to figure out what’s wrong with that but i’ll give it a look once i’m done working on this littre project

This certainly seems like a bug in your Panda build. Are you using a custom-built Panda, or is it the standard 1.5.4 prebuilt distribution available here? Can you email me the egg file in question so I can try to reproduce the problem?

David

OK, I received the egg file in question, and I see the problem. There is indeed a bug in Panda here, but it’s kind of a degenerate case. The bug is that when you have a single CollisionNode that contains more than 65,535 CollisionPolygons, it fails to write a valid bam file.

I can fix the bug, but the bigger question is, are you sure you really want to do this? You have converted all 71,553 triangles of your bus model into CollisionPolygons. This will be ridiculously expensive to test against, and if your only purpose is to test to see what your bus is driving into, absolutely pointless. It’s hard to imagine an application in which you need to make every contour of every seat detectable as a separate collision.

I don’t know what your application is, but you will probably be much better off creating a special geometry (like a box, just six polygons) that encloses the bus, and tag that with a collision tag.

David

You are right this is ridiculous , i’m going to have a simpler geometry calculated . Glad if my mistake helped to correct a small bug through
thank you for your time and paying attention
alex