Dynamic triangle surface used to bind films and droplets to deforming meshes. 更多...
#include <FluidSurfaceBinding.h>
Public 成员函数 | |
| bool | build (const std::vector< glm::vec3 > &positions, const std::vector< uint32_t > &indices, const std::vector< glm::vec2 > &uvs={}) |
| Build topology and initialize the current and previous poses. | |
| void | setTransform (const glm::mat4 &transform) |
| Apply a new rigid pose and preserve the old pose for velocity queries. | |
| bool | setDeformedPositions (const std::vector< glm::vec3 > &worldPositions) |
| Supply a new deformed world-space pose and preserve the previous pose. | |
| void | commitPose () |
| Make the current pose the previous pose, yielding zero surface velocity. | |
| bool | isValid () const |
| True when valid. | |
| int | triangleCount () const |
| Triangle count. | |
| int | vertexCount () const |
| Vertex count. | |
| std::vector< glm::uvec3 > | triangles () const |
| Triangles. | |
| SurfaceSample | evaluate (const SurfaceLocation &location, float dt) const |
| Evaluate a surface address in the current and previous poses. | |
| bool | project (const glm::vec3 &worldPosition, float maxDistance, SurfaceLocation &outLocation) const |
| Find the closest material point on the current surface. | |
| SurfaceWalkResult | walkAcrossSurface (const SurfaceLocation &start, const glm::vec3 &worldDisplacement, int maxCrossings=16) const |
| Move a location by a world-space displacement, crossing triangle edges. | |
| int | adjacentTriangle (uint32_t triangle, int oppositeVertex) const |
| Adjacent triangle. | |
详细描述
Dynamic triangle surface used to bind films and droplets to deforming meshes.
Locations are stored as triangle id plus barycentric coordinates, so they remain stable while the supplied vertices move. Call setTransform for rigid motion or setDeformedPositions for skinning, morphing and procedural deformation.
在文件 FluidSurfaceBinding.h 第 45 行定义.
成员函数说明
◆ adjacentTriangle()
| int eve::fluids::FluidSurfaceBinding::adjacentTriangle | ( | uint32_t | triangle, |
| int | oppositeVertex | ||
| ) | const |
Adjacent triangle.
- 返回
- neighboring triangle across the edge opposite local vertex, or -1 at a boundary.
在文件 FluidSdf.cpp 第 828 行定义.
引用了 oppositeVertex, triangle , 以及 eve::fluids::ocean_script::vector().
被这些函数引用 walkAcrossSurface().
◆ build()
| bool eve::fluids::FluidSurfaceBinding::build | ( | const std::vector< glm::vec3 > & | positions, |
| const std::vector< uint32_t > & | indices, | ||
| const std::vector< glm::vec2 > & | uvs = {} |
||
| ) |
Build topology and initialize the current and previous poses.
- 参数
-
positions model-space vertex positions. indices triangle indices; the size must be a multiple of three. uvs optional per-vertex simulation UVs.
- 返回
- true when the mesh is a valid, non-empty triangle surface.
在文件 FluidSdf.cpp 第 604 行定义.
引用了 a, ab, ac, b, edges, index, indices, key, positions, triangle, triangleCount(), u , 以及 eve::fluids::ocean_script::vector().
被这些函数引用 eve::fluids::FluidSurfaceConstraintAdapter::build().
◆ commitPose()
| void eve::fluids::FluidSurfaceBinding::commitPose | ( | ) |
Make the current pose the previous pose, yielding zero surface velocity.
在文件 FluidSdf.cpp 第 671 行定义.
◆ evaluate()
| SurfaceSample eve::fluids::FluidSurfaceBinding::evaluate | ( | const SurfaceLocation & | location, |
| float | dt | ||
| ) | const |
Evaluate a surface address in the current and previous poses.
- 参数
-
location triangle id and barycentric coordinates. dt seconds between the two poses; non-positive values yield zero velocity.
在文件 FluidSdf.cpp 第 718 行定义.
引用了 bary, eve::fluids::SurfaceLocation::barycentric, dt, edge, isValid(), eve::fluids::SurfaceLocation::triangle, triangleCount() , 以及 eve::fluids::ocean_script::vector().
被这些函数引用 eve::fluids::SurfaceDropletSimulation::addDroplet(), eve::fluids::FluidSurfaceConstraintAdapter::evaluate() , 以及 walkAcrossSurface().
◆ isValid()
| bool eve::fluids::FluidSurfaceBinding::isValid | ( | ) | const |
True when valid.
- 返回
- true when a valid topology and pose are available.
在文件 FluidSdf.cpp 第 673 行定义.
引用了 u.
被这些函数引用 eve::fluids::SurfaceDropletSimulation::addDroplet(), eve::fluids::FluidSurfaceConstraintAdapter::evaluate(), evaluate(), eve::fluids::FluidSurfaceConstraintAdapter::isValid(), eve::fluids::FluidSurfaceConstraintAdapter::project(), project(), setDeformedPositions(), setTransform(), eve::fluids::SurfaceDropletSimulation::step(), eve::fluids::FluidSurfaceConstraintAdapter::walk() , 以及 walkAcrossSurface().
◆ project()
| bool eve::fluids::FluidSurfaceBinding::project | ( | const glm::vec3 & | worldPosition, |
| float | maxDistance, | ||
| SurfaceLocation & | outLocation | ||
| ) | const |
Find the closest material point on the current surface.
- 参数
-
worldPosition point to project. maxDistance maximum accepted distance; negative means unlimited. outLocation receives the closest address.
- 返回
- true when a point within maxDistance was found.
在文件 FluidSdf.cpp 第 740 行定义.
引用了 bary, best, isValid(), point, triangleCount() , 以及 eve::fluids::ocean_script::vector().
被这些函数引用 eve::fluids::FluidSurfaceConstraintAdapter::project().
◆ setDeformedPositions()
| bool eve::fluids::FluidSurfaceBinding::setDeformedPositions | ( | const std::vector< glm::vec3 > & | worldPositions | ) |
Supply a new deformed world-space pose and preserve the previous pose.
- 返回
- false when the vertex count differs from the topology.
在文件 FluidSdf.cpp 第 664 行定义.
引用了 isValid() , 以及 eve::fluids::ocean_script::vector().
被这些函数引用 eve::fluids::FluidSurfaceConstraintAdapter::setDeformedPositions().
◆ setTransform()
Apply a new rigid pose and preserve the old pose for velocity queries.
在文件 FluidSdf.cpp 第 657 行定义.
引用了 isValid().
被这些函数引用 eve::fluids::FluidSurfaceConstraintAdapter::setTransform().
◆ triangleCount()
| int eve::fluids::FluidSurfaceBinding::triangleCount | ( | ) | const |
Triangle count.
- 返回
- number of triangles in the bound topology.
在文件 FluidSdf.cpp 第 678 行定义.
引用了 eve::fluids::ocean_script::vector().
被这些函数引用 eve::fluids::SurfaceDropletSimulation::addDroplet(), build(), eve::fluids::FluidSurfaceConstraintAdapter::evaluate(), evaluate(), project(), triangles() , 以及 walkAcrossSurface().
◆ triangles()
| std::vector< glm::uvec3 > eve::fluids::FluidSurfaceBinding::triangles | ( | ) | const |
Triangles.
- 返回
- indexed triangle topology for wet-film fields and render integration.
在文件 FluidSdf.cpp 第 680 行定义.
引用了 result , 以及 triangleCount().
◆ vertexCount()
|
inline |
◆ walkAcrossSurface()
| SurfaceWalkResult eve::fluids::FluidSurfaceBinding::walkAcrossSurface | ( | const SurfaceLocation & | start, |
| const glm::vec3 & | worldDisplacement, | ||
| int | maxCrossings = 16 |
||
| ) | const |
Move a location by a world-space displacement, crossing triangle edges.
- 参数
-
start initial material-space address. worldDisplacement desired displacement; its normal component is discarded. maxCrossings safety bound for topology traversal.
- 返回
- final address, boundary state and unconsumed displacement.
在文件 FluidSdf.cpp 第 764 行定义.
引用了 adjacentTriangle(), evaluate(), from, isValid(), eve::fluids::SurfaceSample::location, eve::fluids::SurfaceWalkResult::location, result, start, t, to, eve::fluids::SurfaceLocation::triangle, triangleCount() , 以及 eve::fluids::ocean_script::vector().
该类的文档由以下文件生成:
- src/modules/fluids/FluidSurfaceBinding.h
- src/modules/fluids/FluidSdf.cpp