I want to change center of mass.
Is compond object is only way to change center of mass?
Are there other way?
Thank you.
How to change center of mass
Re: How to change center of mass
Yup, right now, Compound is the right choice. Changing the center of mass is equivalent to offsetting the collidable, so rather than having a dedicated 'collidable offset' on everything I just let the Compound handle it. Notably, the Compound (as opposed to the BigCompound) has effectively no overhead for single shapes since it has no acceleration structure.
-
- Posts: 92
- Joined: Fri May 31, 2019 6:30 am
Re: How to change center of mass
Thank you.:3
-
- Posts: 92
- Joined: Fri May 31, 2019 6:30 am
Re: How to change center of mass
Now I try to create a hitbox but seem center of mass is a little off.
1 Are there ways to assign center of mass of hull?
2 Or I want to make a point (0,0,0) center by compound object. How I get location of a point (0,0,0) from the center of mass.
Here is my points for make hull
1 Are there ways to assign center of mass of hull?
2 Or I want to make a point (0,0,0) center by compound object. How I get location of a point (0,0,0) from the center of mass.
Here is my points for make hull
Code: Select all
points.AllocateUnsafely() = new Vector3(0f,0f,0f);
points.AllocateUnsafely() = new Vector3(0.70710677f,0.70710677f,0f);
points.AllocateUnsafely() = new Vector3(1.847759f,0.7653669f,0f);
points.AllocateUnsafely() = new Vector3(1.847759f,-0.7653669f,0f);
points.AllocateUnsafely() = new Vector3(0.70710677f,-0.70710677f,0f);
points.AllocateUnsafely() = new Vector3(0f,0f,1f);
points.AllocateUnsafely() = new Vector3(0.70710677f,0.70710677f,1f);
points.AllocateUnsafely() = new Vector3(1.847759f,0.7653669f,1f);
points.AllocateUnsafely() = new Vector3(1.847759f,-0.7653669f,1f);
points.AllocateUnsafely() = new Vector3(0.70710677f,-0.70710677f,1f);
Re: How to change center of mass
Same as anything else- stick them in a Compound with an offset. If you want to know the center that the ConvexHull got recentered to, the ConvexHullHelper outputs it in the 'center' out parameter.1 Are there ways to assign center of mass of hull?
Not sure what you mean. If you mean making a particular point a compound's center of mass, it's always (0,0,0) in the compound's local space. To make the center of mass of a compound shift relative to its convex children, shift the children.2 Or I want to make a point (0,0,0) center by compound object. How I get location of a point (0,0,0) from the center of mass.
-
- Posts: 92
- Joined: Fri May 31, 2019 6:30 am
Re: How to change center of mass
I mean I want point (0,0,0) in points.AllocateUnsafely to be center.(I want point with x 0.70710677f to be border of cylinder radius 1)
After I move x to 1.847759f - 0.70710677f.
I succeed.
Thank you.
After I move x to 1.847759f - 0.70710677f.
I succeed.
Thank you.