yoshinoToylogic / bulletsharp

Automatically exported from code.google.com/p/bulletsharp
MIT License
0 stars 0 forks source link

Unable to subclass StridingMeshInterface #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to make a subclass of StridingMeshInterface
2. No constructors defined
3.

What is the expected output? What do you see instead?
No possible way to have trimeshes (that I know of) since I need a subclass of 
StridingMeshInterface to pass to the constructor of BvhTriangleMeshShape

What version of the product are you using? On what operating system?
newest, on win7 with VS2010

Please provide any additional information below.
I'm using bulletsharp with mogre and trying to write a c# version of 
http://www.ogre3d.org/tikiwiki/BulletMeshStrider since if I try to add it to 
the bulletsharp build it won't work correctly. (Though that's probably just 
because I'm completely rubbish at building c++)

Original issue reported on code.google.com by pyri...@gmail.com on 23 Aug 2011 at 4:51

GoogleCodeExporter commented 8 years ago
I guess I can just use TriangleMesh for now as a workaround, unless I'm being 
retarded and that's how I'm supposed to do it

Original comment by pyri...@gmail.com on 23 Aug 2011 at 5:30

GoogleCodeExporter commented 8 years ago
Yeah, StridingMeshInterface can't be subclassed, because I haven't found a good 
way to make that work properly yet. Those abstract classes can be tricky to 
wrap.

If you can use TriangleMesh instead, then that's great. I think the performance 
will be better anyway since there won't be any calls to the managed code in the 
subclass during simulation

Thanks for the feedback!

Original comment by andres.traks on 23 Aug 2011 at 11:57

GoogleCodeExporter commented 8 years ago
Yep, got TriangleMesh to work instead. Only problem now is that I have to have 
it in a CollisionObject instead of a RigidBody (since the latter makes my 
raycast vehicles freak out when they touch it), but the wheels of the vehicle 
just go right through the mesh as if it wasn't there, with the chassis sitting 
on top of it. Might be a problem with the raycaster, I don't know

Original comment by pyri...@gmail.com on 24 Aug 2011 at 12:05

GoogleCodeExporter commented 8 years ago
what about VehicleRaycaster? Same issue?

Original comment by pyri...@gmail.com on 24 Aug 2011 at 8:31

GoogleCodeExporter commented 8 years ago
Yeah, extending the wrapper classes isn't supported. I've tried to make those 
classes extendable that are normally subclassed (like DebugDraw), but it's 
always been a bit of a mess.

With BulletSharp it's more reasonable to avoid all kinds of virtual calls to 
managed code such as overridden methods, because going in and out of managed 
mode is expensive.

If you need the extended functionality, then you might want to try the native 
.NET version of Bullet: http://code.google.com/p/bullet-xna/

Original comment by andres.traks on 25 Aug 2011 at 11:04

GoogleCodeExporter commented 8 years ago
I found workarounds for both of the things I asked you about so I guess it 
doesn't really matter much to me any more. Thanks for your help though!

Original comment by pyri...@gmail.com on 25 Aug 2011 at 11:16