[x3d-public] X3DJSAIL Python: setShape() Method not found on CollidableShape parent interface, cannot find in returned object. Need cast.

John Carlson yottzumm at gmail.com
Sun Nov 25 05:04:23 PST 2018


We need the right style to cast abstract returned objects to concrete objects in python.  See attached example.

processScene.python:
     [exec] Traceback (most recent call last):
     [exec]   File "C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\RigidBodyPhysics\UniversalJointfuture.py", line 73, in <module>
     [exec]     .setDEF("BOX-GEOM-1") \
     [exec] AttributeError: 'org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollida' object has no attribute 'setShape'
     [exec] Result: 1
     [echo] C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\RigidBodyPhysics\UniversalJointfuture.py

We should probably grant a prize to whoever gets the right casting that works in all instances.

My best bet for short term is to fold the setDEF into the object constructor.

What do people think?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20181125/818003db/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UniversalJointfuture.py
Type: application/octet-stream
Size: 3859 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20181125/818003db/attachment.obj>


More information about the x3d-public mailing list