From 5d9384fca7a0f1391b2ffedc4822503d4b4d92f0 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Sat, 20 Feb 2021 16:43:12 -0800 Subject: [PATCH] Fix docs typos --- .../java/com/google/android/filament/Camera.java | 12 ++++-------- filament/include/filament/Camera.h | 14 ++++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/android/filament-android/src/main/java/com/google/android/filament/Camera.java b/android/filament-android/src/main/java/com/google/android/filament/Camera.java index d7c1723d6d..489deca9d5 100644 --- a/android/filament-android/src/main/java/com/google/android/filament/Camera.java +++ b/android/filament-android/src/main/java/com/google/android/filament/Camera.java @@ -27,16 +27,12 @@ import androidx.annotation.Size; * *

Creation and destruction

* - * Unlike most Filament objects, Camera doesn't require a builder and can be constructed directly - * using {@link Engine#createCamera}. At the very least, a projection must be defined - * using {@link #setProjection}. In most case, the camera position also needs to be set. - *

- * A Camera object is destroyed using {@link Engine#destroyCamera}. + * In Filament, Camera is a component that must be associated with an entity. To do so, + * use {@link Engine#createCamera(int)}. A Camera component is destroyed using + * {@link Engine#destroyCamera(Camera)}. * *

- *  Engine engine = Engine.create();
- *
- *  Camera myCamera = engine.createCamera();
+ *  Camera myCamera = engine.createCamera(myCameraEntity);
  *  myCamera.setProjection(45, 16.0/9.0, 0.1, 1.0);
  *  myCamera.lookAt(0, 1.60, 1,
  *                  0, 0, 0,
diff --git a/filament/include/filament/Camera.h b/filament/include/filament/Camera.h
index 76eb81dbee..52258359ae 100644
--- a/filament/include/filament/Camera.h
+++ b/filament/include/filament/Camera.h
@@ -39,20 +39,18 @@ namespace filament {
  * Creation and destruction
  * ========================
  *
- * Like all Filament objects, Camera can only be constructed on the heap, however, unlike most
- * Filament objects it doesn't require a builder and can be constructed directly
- * using Engine::createCamera(). At the very least, a projection must be defined
- * using setProjection(). In most case, the camera position also needs to be set.
- *
- * A Camera object is destroyed using Engine::destroy(const Camera*).
+ * In Filament, Camera is a component that must be associated with an entity. To do so,
+ * use Engine::createCamera(Entity). A Camera component is destroyed using
+ * Engine::destroyCameraComponent(Entity).
  *
  * ~~~~~~~~~~~{.cpp}
  *  filament::Engine* engine = filament::Engine::create();
  *
- *  filament::Camera* myCamera = engine->createCamera();
+ *  utils::Entity myCameraEntity = utils::EntityManager::get().create();
+ *  filament::Camera* myCamera = engine->createCamera(myCameraEntity);
  *  myCamera->setProjection(45, 16.0/9.0, 0.1, 1.0);
  *  myCamera->lookAt({0, 1.60, 1}, {0, 0, 0});
- *  engine->destroy(myCamera);
+ *  engine->destroyCameraComponent(myCamera);
  * ~~~~~~~~~~~
  *
  *