playMaker

Author Topic: Get Bounding Sphere Action  (Read 876 times)

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Get Bounding Sphere Action
« on: January 18, 2013, 08:13:52 PM »

Can anyone verify if this action has been written properly?

It seems to work but being such a noob I'm not sure.
If someone has a chance to look at it I'd really appreciate it.

Its purpose is to use the renderer.bounds to query the Mesh Renderer then get the local space centre and spherical bounds expressed as a radius from a all components in a gameObject.

Then draw various debug shapes.

Might there be a better way?

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Get Bounding Sphere Action
« Reply #1 on: January 18, 2013, 08:49:41 PM »

The above script would benefit from an appropriate version of i.e.

      public override string ErrorCheck ()
      {
         return ActionHelpers.CheckOwnerPhysicsSetup (Owner);
      }

Where would I look to find these definitions as a list or where do I go to define such a message.

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Get Bounding Sphere Action
« Reply #2 on: January 18, 2013, 09:31:56 PM »

Ah ha!

For the error check i now use:
[CheckForComponent(typeof(MeshRenderer))]

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Get Bounding Sphere Action
« Reply #3 on: January 19, 2013, 11:40:08 PM »
Revised version of the Action which now includes the Mesh Renderer required warning.

It now executes the debug gizmos draw and calculates all values in OnDrawGizmos and calculates the values only OnEnter.