载入中...
搜索中...
未找到
SceneCameraQueries.cpp
浏览该文件的文档.
34std::string Scene::pickScreenAt(const std::string &hostName, graphics::Camera3D *cam, float screenX, float screenY,
41 return pickRayAt(hostName, ray->origin.x, ray->origin.y, ray->origin.z, ray->direction.x, ray->direction.y,
45std::vector<std::string> Scene::collectFrustumIdsAt(const std::string &hostName, graphics::Camera3D *cam, float viewW,
64Result<int> Scene::applyPcgTerrainCullingAt(const std::string &hostName, graphics::Camera3D *cam, float viewW,
67 if (!host || !cam || !std::isfinite(viewW) || !std::isfinite(viewH) || viewW <= 0.f || viewH <= 0.f || tag.empty())
69 DiagnosticCode::InvalidArgument, "Pcg terrain culling requires host, camera, positive viewport and tag",
74 DiagnosticCode::Unsupported, "Pcg terrain culling needs the graphics camera projection capability",
111 SceneComponent *component = nullptr; // Owner invalidates before destruction; never exposed as a handle.
156SceneHost *SceneComponent::host() const { return dynamic_cast<SceneHost *>(ecs::try_get(hostHandle_)); }
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
React-style scene component: implement build(); setState / markDirty schedules one update before tran...
Definition SceneComponent.h:23
SceneHost * host() const
Returns the currently attached host, or null before attach.
Definition SceneCameraQueries.cpp:156
SceneComponent()
Create an unmounted component; attaching schedules its first update.
Definition SceneCameraQueries.cpp:144
virtual void onMount(SceneHost *host)
Called once when the component is attached to a host.
Definition SceneComponent.h:38
bool updateIfDirty()
Compatibility-only synchronous update; normal edits are flushed automatically.
Definition SceneCameraQueries.cpp:202
void markDirty()
Schedule one rebuild; repeated calls before the next preparation phase coalesce. @thread Owner thread...
Definition SceneCameraQueries.cpp:148
void rebuild(bool forceFull=false)
Compatibility-only synchronous refresh; normal edits use markDirty / setState. @cost Builds the compl...
Definition SceneCameraQueries.cpp:180
ECS mount point for one scene graph (full scene or nested subtree root). Isomorphic to eve::ui::UIHos...
Definition SceneHost.h:89
static eve::Result< SceneHost * > createHost(const std::string &name="")
Creates an ECS-owned scene host with an explicit Result contract.
Definition SceneHost.cpp:129
std::vector< float > getForward() const
Normalized local axes in world space (forward = +Z).
Definition SceneCameraQueries.cpp:446
Scene * getScene() const
Returns the eve.Scene module instance for entity-binding forwarding.
Definition SceneCameraQueries.cpp:303
std::string getChildIdAt(int ordinal) const
Returns the child id at.
Definition SceneCameraQueries.cpp:479
eve::SceneObjectId persistentId() const
Return the persisted UUID of the resolved node, or nil if absent.
Definition SceneCameraQueries.cpp:298
std::vector< float > getWorldPosition() const
Returns the world position.
Definition SceneCameraQueries.cpp:430
bool setRotation(float yaw, float pitch, float roll)
Sets the rotation.
Definition SceneCameraQueries.cpp:337
std::vector< float > getWorldMatrix() const
Column-major 4x4 world matrix, 16 floats.
Definition SceneCameraQueries.cpp:436
SceneHost * resolveHost(const std::string &hostName) const
Host-qualified resolution: empty hostName → currently selected host.
Definition Scene.cpp:869
std::string pickScreenAt(const std::string &hostName, graphics::Camera3D *cam, float screenX, float screenY, float viewW, float viewH) const
Screen-space picking through a Camera3D (camera.screenToRay).
Definition SceneCameraQueries.cpp:34
Result< int > applyPcgTerrainCullingAt(const std::string &hostName, graphics::Camera3D *cam, float viewW, float viewH, const std::string &tag)
Apply PcgScenePlayer frustum visibility to bounded nodes carrying a tag.
Definition SceneCameraQueries.cpp:64
std::vector< std::string > collectFrustumIdsAt(const std::string &hostName, graphics::Camera3D *cam, float viewW, float viewH) const
Ids of nodes whose world AABB intersects the camera frustum.
Definition SceneCameraQueries.cpp:45
std::string pickRayAt(const std::string &hostName, float ox, float oy, float oz, float dx, float dy, float dz) const
Nearest node id hit by a world ray (nodes with bounds), or "".
Definition SceneNodes.cpp:470
void flushPendingComponents()
Flush one batch of live dirty components before host traversal. @thread Owner thread; newly queued ed...
Definition SceneCameraQueries.cpp:119
Definition AvatarInstance.h:34
bool aabbIntersectsFrustum(const glm::mat4 &clip, const glm::mat4 &invClip, const AABB3f &b)
Conservative AABB ↔ frustum overlap (AABB corners + frustum corners).
Definition SceneBounds.h:81
AABB3f worldBoundsOf(const SceneNode &n)
World-space AABB of a node's local bounds (8 corners through world matrix).
Definition SceneBounds.h:26
@ InvalidArgument
@ Unsupported
Definition Container.h:602
Retained scene node (arena). Conceptual GameObject; isomorphic to eve::ui::UINode.
Definition SceneHost.h:46
SceneComponent * component
Definition SceneCameraQueries.cpp:111