Skip to Content
EngineObjectsGameObject

GameObject

This is a WIP project - Expect breaking changes to occur.

Overview

A GameObject represents an object in the game world, containing its position, rotation, scale and mesh data.
It serves as a container for various components that define its behavior, appearance, and interactions with other objects.

In our engine, a GameObject can have components such as:

  • Transform: Defines the position, rotation, and scale of the object in the game world.
  • Renderer: Responsible for rendering the object’s visual representation on the screen.
  • Collider: Handles collision detection and response with other objects.

The GameObject class provides methods to add, remove, and manage these components, allowing developers to create complex and interactive game entities.

GameObject()

public GameObject(Vector3f position, Vector3f rotation, Vector3f scale, Mesh mesh) {}

Constructor for GameObject initializes the object with a position, rotation, scale, and mesh.

update()

public void update() {}

The update method modifies the state of the GameObject over time.\

Example

update()

public void update() { temp += 0.9; position.x = 0; rotation.set(temp, 0, temp); }

In this example implementation, we increment a temporary variable temp and update the rotation of the object based on this variable.

Last updated on