Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SphereCollider

Add this in your code:

#include <engine/physics/sphere_collider.h>

Description

Component to add a sphere-shaped collider to a GameObject.

Public Methods


GetSize

Get the radius of the sphere collider.

float GetSize() const

SetSize

Set the radius of the sphere collider.

Parameters:

  • size: Radius of the sphere
void SetSize(float size)

GetOffset

Get the offset position of the sphere collider.

const Vector3& GetOffset() const

SetOffset

Set the offset position of the sphere collider.

Parameters:

  • offset: Offset position of the sphere
void SetOffset(const Vector3& offset)