Author Topic: Sphere collision and radius  (Read 3255 times)

Offline quixote_arg

  • byte
  • *
  • Posts: 9
    • View Profile
Sphere collision and radius
« on: January 18, 2006, 08:59:22 pm »
Hi, I have a question.

I've created an sphere Object3D with the Primitives class. Something like:

Code: [Select]
Object3D bullet = Primitives.getSphere(0.5f);

When I want to try collision of that object, naturally the checkForCollisionSpherical method seems to be the most appropiate.

However: the checkForCollisionSpherical takes a float as a radius but the getSphere method of the Primitives class takes a float with the scale of the sphere.

How are these two values related with each other?

I mean: what is the radius for a sphere created with Primitives in order to make the collision sphere optimal?

Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Sphere collision and radius
« Reply #1 on: January 18, 2006, 09:46:16 pm »
Quote from: "quixote_arg"

How are these two values related with each other?

I mean: what is the radius for a sphere created with Primitives in order to make the collision sphere optimal?
They should correlate, i.e. a scale of 5 should result in a radius of 5 for the collision detection.