How can I get size of object?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
parapoohda
Posts: 92
Joined: Fri May 31, 2019 6:30 am

How can I get size of object?

Post by parapoohda »

I want to get size of the object. But I can't find it.
Eg. If it is a capsule I want (radius and height).
If it box I want (length width and height).
Thank you

Or I should keep it outside bepu.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: How can I get size of object?

Post by Norbo »

The shape types (Box, Cylinder, etc.) all have fields corresponding to their dimensions. If you want to get a reference to a shape that you've already handed over to the simulation, you can grab it using Simulation.Shapes.GetShape<TShapeType>(shapeIndex).

If you don't need to modify the shape, it can be more convenient to just have an external copy. There's no real cost to copying primitive shapes, they're just a few bytes.
parapoohda
Posts: 92
Joined: Fri May 31, 2019 6:30 am

Re: How can I get size of object?

Post by parapoohda »

Thank you. I think i will copy it
Post Reply