SuperDex Physics C++ API
Loading...
Searching...
No Matches
mochi_debug_draw.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include "mochi_handle.h"
20#include "mochi_structs.h"
21
22/********************************************************************************
23 IMPORTANT: PLEASE KEEP HEADER INCLUDES TO A MINIMUM.
24 If you must include a mochi_core header, then please make sure that it only
25 declares the data types (not containing other implementation details).
26*********************************************************************************/
28
29#include <string_view>
30
31namespace superdex {
32
33class DebugDraw {
34 public:
35 [[nodiscard]] virtual bool IsEnabled() const = 0;
36
37 virtual void Enable(bool enable) = 0;
38
39 [[nodiscard]] virtual int GetNumFeatures() const = 0;
40
41 [[nodiscard]] virtual int FindFeature(std::string_view name) const = 0;
42
43 [[nodiscard]] virtual std::string_view GetFeatureName(int index) const = 0;
44
45 [[nodiscard]] virtual std::string_view GetFeatureDescription(int index) const = 0;
46
47 [[nodiscard]] virtual bool IsFeatureEnabled(int index) const = 0;
48
49 virtual void EnableFeature(int index, bool enable) = 0;
50
51 [[nodiscard]] virtual DebugDrawData GatherData() = 0;
52
53 virtual void EnableActor(ActorHandle actor, bool enable, Error& error) = 0;
54
55 protected:
56 virtual ~DebugDraw() = default; // Owned by superdex::Scene
57};
58
59} // namespace superdex
Manages debug visualization features for a scene.
virtual void EnableActor(ActorHandle actor, bool enable, Error &error)=0
Enable or disable debug drawing for a specific actor.
virtual void Enable(bool enable)=0
Enable or disable debug drawing for the entire scene.
virtual void EnableFeature(int index, bool enable)=0
Enable or disable a specific feature.
virtual bool IsEnabled() const =0
Check if debug drawing is enabled for the scene.
virtual bool IsFeatureEnabled(int index) const =0
Check if a feature is currently enabled.
virtual std::string_view GetFeatureName(int index) const =0
Get the name of a feature by index.
virtual std::string_view GetFeatureDescription(int index) const =0
Get the description of a feature by index.
virtual DebugDrawData GatherData()=0
Generate debug draw primitives for all currently enabled features.
virtual int FindFeature(std::string_view name) const =0
Find a feature by name.
virtual int GetNumFeatures() const =0
Get the number of debug draw features available.
virtual ~DebugDraw()=default
Unique identifier for an Actor within a Scene.
Collection of debug draw primitives.