22.3 C
New York
Thursday, July 3, 2025

Capsule to the collision of the sphere


For my math unit on the college, we now have to manually calculate if a sphere is colliding with a capsule colider.

The data I’ve to go along with is that this;

You’ve gotten the next sphere:

  • LADYBIRD3 – CENTROPOINT = (0, 0, 0), Radius = 18.0

And the following capsule

  • Sanic – Bottompoint = (0.2,6), Toppoint = (0, 12, 6), Radio = 5.0

Decide if the next collision happens in Sabia:

Sanic & Markbird3

At our convention, we’re instructed the next;

Be aware: normalize on this step will not be necessary

First, we’re going to confirm the DOT product of AC and AB

  • If this DOT product is lower than 0, that signifies that the closest level of the road section A C is a

  • In order that we are able to return the sq. size of AC and cease any further calculation

  • Now we carry out the identical check with the DOT product of BA and BC

  • As soon as once more, if the DOT product is lower than 0, B could be the closest level within the line to C section, so we might solely return the size of BC and cease any further calculation.

Projection … If the DOT product returned> 0 for each factors of the road section, we have to challenge C on AB to acquire the gap. There may be an environment friendly approach to get hold of the sq. distance if that is all that issues to us:

  • SQUAREDDISTANCE = AC.LENGTHSQ – (AC. AB) * (AC. AB) / AB.LENGTHSQ

  • When doing the product right here, we should make sure that it isn’t standardized.

And the ultimate step is to make use of this sq. distance and examine it with the sum of each radios work to find out if there may be an intersection.


So, I’m making an attempt to calculate whether or not they cross or don’t use the knowledge above.

All I’ve achieved is that this (take away the positions of Ladybird3 from the place of the sanícías (TP, BP))

AC = (0, 2, 6)

AB = (0, -10, 0)

Dot = -20 product

Ba = (0, 10, 0)

BC = (0, 12, 6)

Dot = 120 product

Plainly with the values ​​that I’m acquiring they aren’t appropriate, or the method I’m doing is improper … Can anybody level me in the best route?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles