Skip to main content

SphericalSurface

A class in Root.Township, Alta.Chunks.

Spawn surface that finds points by raycasting outward in random directions from the object's centre, optionally only over the upper hemisphere. Its settings are saved with the object.

Constructors​

MemberWhat it is
SphericalSurface()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private bool isHemisphereOnly cast over the half facing the object's up.
private float radiusHow far the raycasts reach.

Methods​

MemberWhat it is
override bool GetPosition(out Vector3 position, out Vector3 normal)Tries up to the global retry count of random outward raycasts of radius length and returns the first hit.
override void SetSize(float size)Sets the radius.
1 private and internal method
MemberWhat it is
private void OnDrawGizmosSelected()Draws the sphere in the scene view (not for a hemisphere).