载入中...
搜索中...
未找到
eve::math::Math类 参考
Math module — glm-backed vectors/matrices, noise, bezier, random. Script: math <- eve.Math();
更多...
#include <Math.h>
类 eve::math::Math 继承关系图:
Public 成员函数 | |
| Module_REG (Math) | |
| Math () | |
| ~Math () override=default | |
| Vec2 * | newVec2 (float x=0.f, float y=0.f) |
| Vec3 * | newVec3 (float x=0.f, float y=0.f, float z=0.f) |
| Mat4 * | newMat4 () |
| Mat4 * | newMat4Translation (float x, float y, float z) |
| Mat4 * | newMat4Scale (float sx, float sy, float sz) |
| Mat4 * | newMat4RotationZ (float radians) |
| float | clamp (float x, float lo, float hi) const |
| float | lerp (float a, float b, float t) const |
| float | smoothstep (float edge0, float edge1, float x) const |
| float | remap (float x, float inMin, float inMax, float outMin, float outMax) const |
| float | degToRad (float deg) const |
| float | radToDeg (float rad) const |
| float | sign (float x) const |
| float | fract (float x) const |
| float | approach (float current, float target, float maxDelta) const |
| float | wrap (float x, float lo, float hi) const |
| float | pingPong (float t, float length) const |
| float | inverseLerp (float a, float b, float x) const |
| Inverse of lerp: t such that lerp(a,b,t) ≈ x. | |
| float | smootherstep (float edge0, float edge1, float x) const |
| float | bias (float t, float b) const |
| Schlick bias/gain — shape [0,1] distributions (procgen falloff). | |
| float | gain (float t, float g) const |
| float | ease (float t, const std::string &kind) const |
| Easing on [0,1]. kind: "linear"|"inQuad"|"outQuad"|"inOutQuad"|"inCubic"|"outCubic"|"inOutCubic"| "inSine"|"outSine"|"inOutSine"|"inExpo"|"outExpo"|"inOutExpo" | |
| float | step (float edge, float x) const |
| float | quantize (float x, float stepSize) const |
| float | snap (float x, float grid) const |
| float | length2 (float x, float y) const |
| float | length3 (float x, float y, float z) const |
| float | distance2 (float x1, float y1, float x2, float y2) const |
| float | distance3 (float x1, float y1, float z1, float x2, float y2, float z2) const |
| float | dot2 (float x1, float y1, float x2, float y2) const |
| float | dot3 (float x1, float y1, float z1, float x2, float y2, float z2) const |
| float | cross2 (float x1, float y1, float x2, float y2) const |
| float | angle2 (float x, float y) const |
| float | angleBetween2 (float x1, float y1, float x2, float y2) const |
| float | lerpAngle (float a, float b, float t) const |
| float | normalize2X (float x, float y) const |
| float | normalize2Y (float x, float y) const |
| float | normalize3X (float x, float y, float z) const |
| float | normalize3Y (float x, float y, float z) const |
| float | normalize3Z (float x, float y, float z) const |
| float | rotate2X (float x, float y, float radians) const |
| Rotate (x,y) by radians around origin. | |
| float | rotate2Y (float x, float y, float radians) const |
| float | polarX (float radius, float radians) const |
| float | polarY (float radius, float radians) const |
| float | cartesianRadius (float x, float y) const |
| float | cartesianAngle (float x, float y) const |
| bool | pointInCircle (float px, float py, float cx, float cy, float radius) const |
| bool | pointInRect (float px, float py, float rx, float ry, float rw, float rh) const |
| bool | circlesOverlap (float x1, float y1, float r1, float x2, float y2, float r2) const |
| bool | rectsOverlap (float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) const |
| bool | circleRectOverlap (float cx, float cy, float radius, float rx, float ry, float rw, float rh) const |
| bool | segmentsIntersect (float ax, float ay, float bx, float by, float cx, float cy, float dx, float dy) const |
| True if segments AB and CD intersect (including endpoints). | |
| float | raycastCircle2 (float ox, float oy, float dx, float dy, float cx, float cy, float radius) const |
| Ray vs circle. Hit point = (ox,oy) + t*(dx,dy). Returns t >= 0 on hit, else -1. Direction need not be unit; for a segment use dir = B-A and accept t in [0,1]. | |
| float | raycastRect2 (float ox, float oy, float dx, float dy, float rx, float ry, float rw, float rh) const |
| Ray vs axis-aligned rect (x,y,w,h). Returns parametric t >= 0, else -1. | |
| float | closestPointOnSegment2X (float px, float py, float ax, float ay, float bx, float by) const |
| float | closestPointOnSegment2Y (float px, float py, float ax, float ay, float bx, float by) const |
| bool | pointInSphere (float px, float py, float pz, float cx, float cy, float cz, float radius) const |
| bool | pointInBox (float px, float py, float pz, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const |
| Inclusive AABB test against [min,max] on each axis. | |
| bool | spheresOverlap (float x1, float y1, float z1, float r1, float x2, float y2, float z2, float r2) const |
| bool | boxesOverlap (float minAx, float minAy, float minAz, float maxAx, float maxAy, float maxAz, float minBx, float minBy, float minBz, float maxBx, float maxBy, float maxBz) const |
| float | raycastSphere (float ox, float oy, float oz, float dx, float dy, float dz, float cx, float cy, float cz, float radius) const |
| float | raycastBox (float ox, float oy, float oz, float dx, float dy, float dz, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const |
| float | raycastPlane (float ox, float oy, float oz, float dx, float dy, float dz, float px, float py, float pz, float nx, float ny, float nz) const |
| Ray vs infinite plane through (px,py,pz) with normal (nx,ny,nz). Returns parametric t, or -1 if parallel / behind ray origin. | |
| float | closestPointOnSegment3X (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const |
| float | closestPointOnSegment3Y (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const |
| float | closestPointOnSegment3Z (float px, float py, float pz, float ax, float ay, float az, float bx, float by, float bz) const |
| float | bilinear (float v00, float v10, float v01, float v11, float u, float v) const |
| Bilinear sample of 4 corners (v00,v10,v01,v11) with u,v in [0,1]. | |
| void | setRandomSeed (uint32_t seed) |
| void | setRandomSeedFromTime () |
| uint32_t | getRandomSeed () const |
| float | random () |
| float | randomRange (float min, float max) |
| int | randomInt (int min, int maxInclusive) |
| float | randomGaussian (float mean, float stddev) |
| Box-Muller Gaussian (mean, stddev). | |
| float | hash1 (float x) const |
| float | hash2 (float x, float y) const |
| float | hash3 (float x, float y, float z) const |
| float | noise1 (float x) const |
| float | noise2 (float x, float y) const |
| float | noise3 (float x, float y, float z) const |
| float | perlin2 (float x, float y) const |
| float | perlin3 (float x, float y, float z) const |
| float | fbm2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Fractal Brownian Motion / ridged / turbulence. octaves >= 1; lacunarity ~2; gain/persistence ~0.5. | |
| float | fbm3 (float x, float y, float z, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| float | ridged2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| float | ridged3 (float x, float y, float z, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| float | turbulence2 (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| float | voronoi2 (float x, float y) const |
| Worley / Voronoi F1 distance in [0, ~1.5] (cell size 1). voronoiEdge2 = F2 - F1 (cell borders). | |
| float | voronoiEdge2 (float x, float y) const |
| float | warpNoise2 (float x, float y, float warpAmp=1.f) const |
| Domain warp: sample noise at (x,y) + warpAmp * (noise-0.5). Useful for organic terrain / caves. | |
| float | bezierQuadratic (float t, float p0, float p1, float p2) const |
| float | bezierCubic (float t, float p0, float p1, float p2, float p3) const |
| float | bezierQuadratic2X (float t, float x0, float y0, float x1, float y1, float x2, float y2) const |
| float | bezierQuadratic2Y (float t, float x0, float y0, float x1, float y1, float x2, float y2) const |
| float | bezierCubic2X (float t, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) const |
| float | bezierCubic2Y (float t, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) const |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
Math module — glm-backed vectors/matrices, noise, bezier, random. Script: math <- eve.Math();
No overloads: distinct names (length2/length3, noise1/noise2/…).
构造及析构函数说明
◆ Math()
◆ ~Math()
|
overridedefault |
成员函数说明
◆ angle2()
| float eve::math::Math::angle2 | ( | float | x, |
| float | y | ||
| ) | const |
◆ angleBetween2()
| float eve::math::Math::angleBetween2 | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
◆ approach()
| float eve::math::Math::approach | ( | float | current, |
| float | target, | ||
| float | maxDelta | ||
| ) | const |
◆ bezierCubic()
| float eve::math::Math::bezierCubic | ( | float | t, |
| float | p0, | ||
| float | p1, | ||
| float | p2, | ||
| float | p3 | ||
| ) | const |
◆ bezierCubic2X()
| float eve::math::Math::bezierCubic2X | ( | float | t, |
| float | x0, | ||
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | x3, | ||
| float | y3 | ||
| ) | const |
引用了 bezierCubic().
◆ bezierCubic2Y()
| float eve::math::Math::bezierCubic2Y | ( | float | t, |
| float | x0, | ||
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | x3, | ||
| float | y3 | ||
| ) | const |
引用了 bezierCubic().
◆ bezierQuadratic()
| float eve::math::Math::bezierQuadratic | ( | float | t, |
| float | p0, | ||
| float | p1, | ||
| float | p2 | ||
| ) | const |
◆ bezierQuadratic2X()
| float eve::math::Math::bezierQuadratic2X | ( | float | t, |
| float | x0, | ||
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
引用了 bezierQuadratic().
◆ bezierQuadratic2Y()
| float eve::math::Math::bezierQuadratic2Y | ( | float | t, |
| float | x0, | ||
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
引用了 bezierQuadratic().
◆ bias()
| float eve::math::Math::bias | ( | float | t, |
| float | b | ||
| ) | const |
◆ bilinear()
| float eve::math::Math::bilinear | ( | float | v00, |
| float | v10, | ||
| float | v01, | ||
| float | v11, | ||
| float | u, | ||
| float | v | ||
| ) | const |
◆ boxesOverlap()
| bool eve::math::Math::boxesOverlap | ( | float | minAx, |
| float | minAy, | ||
| float | minAz, | ||
| float | maxAx, | ||
| float | maxAy, | ||
| float | maxAz, | ||
| float | minBx, | ||
| float | minBy, | ||
| float | minBz, | ||
| float | maxBx, | ||
| float | maxBy, | ||
| float | maxBz | ||
| ) | const |
◆ cartesianAngle()
| float eve::math::Math::cartesianAngle | ( | float | x, |
| float | y | ||
| ) | const |
◆ cartesianRadius()
| float eve::math::Math::cartesianRadius | ( | float | x, |
| float | y | ||
| ) | const |
◆ circleRectOverlap()
| bool eve::math::Math::circleRectOverlap | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| float | rx, | ||
| float | ry, | ||
| float | rw, | ||
| float | rh | ||
| ) | const |
◆ circlesOverlap()
| bool eve::math::Math::circlesOverlap | ( | float | x1, |
| float | y1, | ||
| float | r1, | ||
| float | x2, | ||
| float | y2, | ||
| float | r2 | ||
| ) | const |
◆ clamp()
◆ closestPointOnSegment2X()
| float eve::math::Math::closestPointOnSegment2X | ( | float | px, |
| float | py, | ||
| float | ax, | ||
| float | ay, | ||
| float | bx, | ||
| float | by | ||
| ) | const |
◆ closestPointOnSegment2Y()
| float eve::math::Math::closestPointOnSegment2Y | ( | float | px, |
| float | py, | ||
| float | ax, | ||
| float | ay, | ||
| float | bx, | ||
| float | by | ||
| ) | const |
◆ closestPointOnSegment3X()
| float eve::math::Math::closestPointOnSegment3X | ( | float | px, |
| float | py, | ||
| float | pz, | ||
| float | ax, | ||
| float | ay, | ||
| float | az, | ||
| float | bx, | ||
| float | by, | ||
| float | bz | ||
| ) | const |
◆ closestPointOnSegment3Y()
| float eve::math::Math::closestPointOnSegment3Y | ( | float | px, |
| float | py, | ||
| float | pz, | ||
| float | ax, | ||
| float | ay, | ||
| float | az, | ||
| float | bx, | ||
| float | by, | ||
| float | bz | ||
| ) | const |
◆ closestPointOnSegment3Z()
| float eve::math::Math::closestPointOnSegment3Z | ( | float | px, |
| float | py, | ||
| float | pz, | ||
| float | ax, | ||
| float | ay, | ||
| float | az, | ||
| float | bx, | ||
| float | by, | ||
| float | bz | ||
| ) | const |
◆ cross2()
| float eve::math::Math::cross2 | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
◆ degToRad()
◆ distance2()
| float eve::math::Math::distance2 | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
◆ distance3()
| float eve::math::Math::distance3 | ( | float | x1, |
| float | y1, | ||
| float | z1, | ||
| float | x2, | ||
| float | y2, | ||
| float | z2 | ||
| ) | const |
◆ dot2()
| float eve::math::Math::dot2 | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) | const |
◆ dot3()
| float eve::math::Math::dot3 | ( | float | x1, |
| float | y1, | ||
| float | z1, | ||
| float | x2, | ||
| float | y2, | ||
| float | z2 | ||
| ) | const |
◆ ease()
| float eve::math::Math::ease | ( | float | t, |
| const std::string & | kind | ||
| ) | const |
◆ fbm2()
◆ fbm3()
◆ fract()
◆ gain()
| float eve::math::Math::gain | ( | float | t, |
| float | g | ||
| ) | const |
◆ getRandomSeed()
◆ hash1()
◆ hash2()
◆ hash3()
| float eve::math::Math::hash3 | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ inverseLerp()
| float eve::math::Math::inverseLerp | ( | float | a, |
| float | b, | ||
| float | x | ||
| ) | const |
◆ length2()
| float eve::math::Math::length2 | ( | float | x, |
| float | y | ||
| ) | const |
被这些函数引用 cartesianRadius(), distance2(), normalize2X() , 以及 normalize2Y().
◆ length3()
| float eve::math::Math::length3 | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
被这些函数引用 distance3(), normalize3X(), normalize3Y() , 以及 normalize3Z().
◆ lerp()
| float eve::math::Math::lerp | ( | float | a, |
| float | b, | ||
| float | t | ||
| ) | const |
◆ lerpAngle()
| float eve::math::Math::lerpAngle | ( | float | a, |
| float | b, | ||
| float | t | ||
| ) | const |
◆ Module_REG()
| eve::math::Math::Module_REG | ( | Math | ) |
◆ newMat4()
◆ newMat4RotationZ()
◆ newMat4Scale()
◆ newMat4Translation()
| Mat4 * eve::math::Math::newMat4Translation | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ newVec2()
◆ newVec3()
◆ noise1()
◆ noise2()
| float eve::math::Math::noise2 | ( | float | x, |
| float | y | ||
| ) | const |
◆ noise3()
| float eve::math::Math::noise3 | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ normalize2X()
| float eve::math::Math::normalize2X | ( | float | x, |
| float | y | ||
| ) | const |
◆ normalize2Y()
| float eve::math::Math::normalize2Y | ( | float | x, |
| float | y | ||
| ) | const |
◆ normalize3X()
| float eve::math::Math::normalize3X | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ normalize3Y()
| float eve::math::Math::normalize3Y | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ normalize3Z()
| float eve::math::Math::normalize3Z | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ perlin2()
◆ perlin3()
| float eve::math::Math::perlin3 | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ pingPong()
◆ pointInBox()
| bool eve::math::Math::pointInBox | ( | float | px, |
| float | py, | ||
| float | pz, | ||
| float | minX, | ||
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) | const |
◆ pointInCircle()
| bool eve::math::Math::pointInCircle | ( | float | px, |
| float | py, | ||
| float | cx, | ||
| float | cy, | ||
| float | radius | ||
| ) | const |
◆ pointInRect()
| bool eve::math::Math::pointInRect | ( | float | px, |
| float | py, | ||
| float | rx, | ||
| float | ry, | ||
| float | rw, | ||
| float | rh | ||
| ) | const |
◆ pointInSphere()
| bool eve::math::Math::pointInSphere | ( | float | px, |
| float | py, | ||
| float | pz, | ||
| float | cx, | ||
| float | cy, | ||
| float | cz, | ||
| float | radius | ||
| ) | const |
◆ polarX()
◆ polarY()
◆ quantize()
◆ radToDeg()
◆ random()
◆ randomGaussian()
| float eve::math::Math::randomGaussian | ( | float | mean, |
| float | stddev | ||
| ) |
◆ randomInt()
◆ randomRange()
◆ raycastBox()
| float eve::math::Math::raycastBox | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz, | ||
| float | minX, | ||
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) | const |
◆ raycastCircle2()
| float eve::math::Math::raycastCircle2 | ( | float | ox, |
| float | oy, | ||
| float | dx, | ||
| float | dy, | ||
| float | cx, | ||
| float | cy, | ||
| float | radius | ||
| ) | const |
◆ raycastPlane()
| float eve::math::Math::raycastPlane | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz, | ||
| float | px, | ||
| float | py, | ||
| float | pz, | ||
| float | nx, | ||
| float | ny, | ||
| float | nz | ||
| ) | const |
◆ raycastRect2()
| float eve::math::Math::raycastRect2 | ( | float | ox, |
| float | oy, | ||
| float | dx, | ||
| float | dy, | ||
| float | rx, | ||
| float | ry, | ||
| float | rw, | ||
| float | rh | ||
| ) | const |
◆ raycastSphere()
| float eve::math::Math::raycastSphere | ( | float | ox, |
| float | oy, | ||
| float | oz, | ||
| float | dx, | ||
| float | dy, | ||
| float | dz, | ||
| float | cx, | ||
| float | cy, | ||
| float | cz, | ||
| float | radius | ||
| ) | const |
◆ rectsOverlap()
| bool eve::math::Math::rectsOverlap | ( | float | x1, |
| float | y1, | ||
| float | w1, | ||
| float | h1, | ||
| float | x2, | ||
| float | y2, | ||
| float | w2, | ||
| float | h2 | ||
| ) | const |
◆ remap()
| float eve::math::Math::remap | ( | float | x, |
| float | inMin, | ||
| float | inMax, | ||
| float | outMin, | ||
| float | outMax | ||
| ) | const |
◆ ridged2()
◆ ridged3()
◆ rotate2X()
| float eve::math::Math::rotate2X | ( | float | x, |
| float | y, | ||
| float | radians | ||
| ) | const |
◆ rotate2Y()
| float eve::math::Math::rotate2Y | ( | float | x, |
| float | y, | ||
| float | radians | ||
| ) | const |
◆ segmentsIntersect()
| bool eve::math::Math::segmentsIntersect | ( | float | ax, |
| float | ay, | ||
| float | bx, | ||
| float | by, | ||
| float | cx, | ||
| float | cy, | ||
| float | dx, | ||
| float | dy | ||
| ) | const |
◆ setRandomSeed()
| void eve::math::Math::setRandomSeed | ( | uint32_t | seed | ) |
◆ setRandomSeedFromTime()
| void eve::math::Math::setRandomSeedFromTime | ( | ) |
引用了 setRandomSeed().
◆ sign()
| float eve::math::Math::sign | ( | float | x | ) | const |
◆ smootherstep()
| float eve::math::Math::smootherstep | ( | float | edge0, |
| float | edge1, | ||
| float | x | ||
| ) | const |
◆ smoothstep()
| float eve::math::Math::smoothstep | ( | float | edge0, |
| float | edge1, | ||
| float | x | ||
| ) | const |
◆ snap()
◆ spheresOverlap()
| bool eve::math::Math::spheresOverlap | ( | float | x1, |
| float | y1, | ||
| float | z1, | ||
| float | r1, | ||
| float | x2, | ||
| float | y2, | ||
| float | z2, | ||
| float | r2 | ||
| ) | const |
◆ step()
◆ turbulence2()
◆ voronoi2()
| float eve::math::Math::voronoi2 | ( | float | x, |
| float | y | ||
| ) | const |
◆ voronoiEdge2()
| float eve::math::Math::voronoiEdge2 | ( | float | x, |
| float | y | ||
| ) | const |
◆ warpNoise2()
| float eve::math::Math::warpNoise2 | ( | float | x, |
| float | y, | ||
| float | warpAmp = 1.f |
||
| ) | const |
◆ wrap()
| float eve::math::Math::wrap | ( | float | x, |
| float | lo, | ||
| float | hi | ||
| ) | const |
该类的文档由以下文件生成:
Public 成员函数 继承自