Announcement

Collapse
No announcement yet.

Skydome Collision - Pawns Collide but Vehicles Don't

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    To make the calculation Spoof, wouldn't the Skydome need to be a perfect sphere? (Mine is more like a 'squashed oval')

    Comment


      #17
      A general solution would be to project the origin->player vector onto the skydome, and then derive the distance. But that's a lot more math.

      Alternatively, if your dome is world aligned and squashed in the z axis you can employ a simple scalar adjustment which normalises the result back into a sphere.

      Code:
      // vector difference between vehicle and dome center
      Vector delta = vehicle.location - dome.location;
      
      // scale z by the dome's scale
      delta.z *= dome.scale.z;
      
      // vector magnitude based on sphere
      if( VSize( delta ) > radius )
      {
          // ...
      }
      If the dome is centered at the origin the first line can be simplified to:

      Code:
      Vector delta = vehicle.Location;
      There are other ways to do this too. Personally I'd keep the dome entirely cosmetic, either very large or snapped to the camera location, or both. Collisions and transitions are then just spherical distances from the world origin. The distance can be used to interpolate into fog/tone transitions, etc.

      Comment


        #18
        Thanks for the tips Spoof. I'll give them some thought. Unfortunately I can't easily change the Skydome now as its lock-step in sync with about 30,000 other meshes making up the planet surface...

        Comment

        Working...
        X