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 » Thu Mar 05, 2020 8:47 am

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: 4889
Joined: Tue Jul 04, 2006 4:45 am

Re: How can I get size of object?

Post by Norbo » Thu Mar 05, 2020 10:28 pm

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 » Fri Mar 06, 2020 1:28 am

Thank you. I think i will copy it

Post Reply