Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class GameScene(
val scene: threejs.Scene = new threejs.Scene, // scene is mutable object
var objects: Map[Double, GameObject] = Map[Double, GameObject]()) {
def add(gameObject: GameObject) = {
scene.add(gameObject.object3d)
objects = objects + (gameObject.object3d.id -> gameObject)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.