update headers

This commit is contained in:
Nick Fisher
2022-12-05 17:51:44 +08:00
parent 8d562f1742
commit dd100653dc
234 changed files with 62619 additions and 9800 deletions

View File

@@ -60,7 +60,7 @@ public:
* Minimum time that automation waits between applying a settings object and advancing
* to the next test case. Specified in seconds.
*/
float sleepDuration = 0.2;
float sleepDuration = 0.2f;
/**
* Similar to sleepDuration, but expressed as a frame count. Both the minimum sleep time
@@ -158,7 +158,7 @@ public:
* @param content Contains the Filament View, Materials, and Renderer that get modified.
* @param deltaTime The amount of time that has passed since the previous tick in seconds.
*/
void tick(const ViewerContent& content, float deltaTime);
void tick(Engine* engine, const ViewerContent& content, float deltaTime);
/**
* Mutates a set of client-owned Filament objects according to a JSON string.
@@ -173,7 +173,7 @@ public:
* @param jsonLength Number of characters in the json string.
* @param content Contains a set of Filament objects that you want to mutate.
*/
void applySettings(const char* json, size_t jsonLength, const ViewerContent& content);
void applySettings(Engine* engine, const char* json, size_t jsonLength, const ViewerContent& content);
/**
* Gets a color grading object that corresponds to the latest settings.

View File

@@ -76,11 +76,11 @@ using GuardBandOptions = filament::View::GuardBandOptions;
using LightManager = filament::LightManager;
// These functions push all editable property values to their respective Filament objects.
void applySettings(const ViewSettings& settings, View* dest);
void applySettings(const MaterialSettings& settings, MaterialInstance* dest);
void applySettings(const LightSettings& settings, IndirectLight* ibl, utils::Entity sunlight,
void applySettings(Engine* engine, const ViewSettings& settings, View* dest);
void applySettings(Engine* engine, const MaterialSettings& settings, MaterialInstance* dest);
void applySettings(Engine* engine, const LightSettings& settings, IndirectLight* ibl, utils::Entity sunlight,
utils::Entity* sceneLights, size_t sceneLightCount, LightManager* lm, Scene* scene, View* view);
void applySettings(const ViewerOptions& settings, Camera* camera, Skybox* skybox,
void applySettings(Engine* engine, const ViewerOptions& settings, Camera* camera, Skybox* skybox,
Renderer* renderer);
// Creates a new ColorGrading object based on the given settings.
@@ -213,6 +213,7 @@ struct ViewerOptions {
float cameraFocalLength = 28.0f;
float cameraFocusDistance = 10.0f;
bool autoScaleEnabled = true;
bool autoInstancingEnabled = false;
};
struct Settings {

View File

@@ -69,7 +69,7 @@ public:
* Upon construction, the simple viewer may create some additional Filament objects (such as
* light sources) that it owns.
*/
ViewerGui(filament::Engine* engine, filament::Scene* scene, filament::View* view,
ViewerGui(Engine* engine, Scene* scene, View* view,
int sidebarWidth = DEFAULT_SIDEBAR_WIDTH);
/**
@@ -78,17 +78,17 @@ public:
~ViewerGui();
/**
* Sets the viewer's current asset.
* Sets the viewer's current asset and instance.
*
* The viewer does not claim ownership over the asset or its entities. Clients should use
* AssetLoader and ResourceLoader to load an asset before passing it in.
*
* This method does not add renderables to the scene; see populateScene().
*
* @param asset The asset to view.
* @param instanceToAnimate Optional instance from which to get the animator.
* @param instance The asset to view.
* @param instance The instance to view.
*/
void setAsset(FilamentAsset* asset, FilamentInstance* instanceToAnimate = nullptr);
void setAsset(FilamentAsset* asset, FilamentInstance* instance);
/**
* Adds the asset's ready-to-render entities into the scene.
@@ -108,13 +108,15 @@ public:
/**
* Sets or changes the current scene's IBL to allow the UI manipulate it.
*/
void setIndirectLight(filament::IndirectLight* ibl, filament::math::float3 const* sh3);
void setIndirectLight(IndirectLight* ibl, math::float3 const* sh3);
/**
* Applies the currently-selected glTF animation to the transformation hierarchy and updates
* the bone matrices on all renderables.
*
* If an instance is provided, animation is applied to it rather than the "set" instance.
*/
void applyAnimation(double currentTime);
void applyAnimation(double currentTime, FilamentInstance* instance = nullptr);
/**
* Constructs ImGui controls for the current frame and responds to everything that the user has
@@ -135,7 +137,7 @@ public:
* its callback. Note that the first call might be slower since it requires the creation of the
* internal ImGuiHelper instance.
*/
void renderUserInterface(float timeStepInSeconds, filament::View* guiView, float pixelRatio);
void renderUserInterface(float timeStepInSeconds, View* guiView, float pixelRatio);
/**
* Event-passing methods, useful only when ViewerGui manages its own instance of ImGuiHelper.
@@ -210,7 +212,7 @@ public:
/**
* Adjusts the intensity of the IBL.
* See also filament::IndirectLight::setIntensity().
* See also IndirectLight::setIntensity().
* Defaults to 30000.0.
*/
void setIBLIntensity(float brightness) { mSettings.lighting.iblIntensity = brightness; }
@@ -239,9 +241,9 @@ private:
void sceneSelectionUI();
// Immutable properties set from the constructor.
filament::Engine* const mEngine;
filament::Scene* const mScene;
filament::View* const mView;
Engine* const mEngine;
Scene* const mScene;
View* const mView;
const utils::Entity mSunlight;
// Lazily instantiated fields.
@@ -249,8 +251,8 @@ private:
// Properties that can be changed from the application.
FilamentAsset* mAsset = nullptr;
Animator* mAnimator = nullptr;
filament::IndirectLight* mIndirectLight = nullptr;
FilamentInstance* mInstance = nullptr;
IndirectLight* mIndirectLight = nullptr;
std::function<void()> mCustomUI;
// Properties that can be changed from the UI.
@@ -283,7 +285,7 @@ private:
};
UTILS_PUBLIC
filament::math::mat4f fitIntoUnitCube(const filament::Aabb& bounds, float zoffset);
math::mat4f fitIntoUnitCube(const Aabb& bounds, float zoffset);
} // namespace viewer
} // namespace filament