sashimi library
A sprite stacking framework build on top of Flame.
Classes
- Aabb2
- Defines a 2-dimensional axis-aligned bounding box between a min and a max position.
- Aabb3
- Defines a 3-dimensional axis-aligned bounding box between a min and a max position.
- BillboardSprite
-
A component that renders a
Sprite
in the world, always facing the camera. - Canvas
- An interface for recording graphical operations.
- Color
- An immutable color value in ARGB format.
- ColoredCuboid
- A cuboid that has a different color for each slice.
- ColoredCylinder
- A cylinder that has a different color for each slice.
-
CullComponent<
T extends SashimiOwner< SashimiObject> > - A component that culls its children based on whether they are inside the screen or not.
- Frustum
- Defines a frustum constructed out of six Planes.
- Image
- Opaque handle to raw decoded image data (pixels).
- IntersectionResult
- Defines a result of an intersection test.
- Matrix2
- 2D Matrix. Values are stored in column major order.
- Matrix3
- 3D Matrix. Values are stored in column major order.
- Matrix4
- 4D Matrix. Values are stored in column major order.
- Model
- A component that models multiple slices of a 3D object.
- NotifyingVector3
- Extension of the standard Vector3 class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this vector changes.
- Obb3
- Defines a 3-dimensional oriented bounding box defined with a center, halfExtents and axes.
- Offset
- An immutable 2D floating-point offset.
- Path
- A complex, one-dimensional subset of a plane.
- Plane
- Quad
- Defines a quad by four points.
- Quaternion
- Defines a Quaternion (a four-dimensional vector) for efficient rotation calculations.
- Ray
- Defines a Ray by an origin and a direction.
- Rect
- An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.
- SashimiCamera
- The camera used by the Sashimi Engine.
- SashimiController
- The controller of a SashimiObject.
- SashimiEngine
- The engine behind the Sashimi engine.
- SashimiGame
- The game that provides pseudo 3D features.
- SashimiObject
- Abstract class for defining objects in the Sashimi engine.
-
SashimiSlice<
Owner extends SashimiObject> - Represents a slice of a SashimiObject.
- SimplexNoise
- Size
- Holds a 2D floating-point size.
- Sphere
- Defines a sphere with a center and a radius.
- Triangle
- Defines a triangle by three points.
- Vector
- Base class for vectors
- Vector2
- 2D column vector.
- Vector3
- 3D column vector.
- Vector4
- 4D column vector.
Mixins
-
SashimiOwner<
Owner extends SashimiObject> - A mixin that describes who the owner is of a component that was created from a SashimiObject.
Extensions
- Aabb2Extension on Aabb2
- CanvasExtension on Canvas
- ColorExtension on Color
- DoubleExtension on double
- ImageExtension on Image
-
ListExtension
on List<
E> - Matrix4Extension on Matrix4
- OffsetExtension on Offset
- PaintExtension on Paint
- PathExtension on Path
- PictureExtension on Picture
-
RectangleExtension
on Rectangle<
num> - RectExtension on Rect
- SizeExtension on Size
- Vector2Extension on Vector2
Constants
- degrees2Radians → const double
- Constant factor to convert and angle from degrees to radians.
- radians2Degrees → const double
- Constant factor to convert and angle from radians to degrees.
Functions
-
absoluteError(
dynamic calculated, dynamic correct) → double -
Returns absolute error between
calculated
andcorrect
. The type ofcalculated
andcorrect
must match and can be any vector, matrix, or quaternion. -
buildPlaneVectors(
Vector3 planeNormal, Vector3 u, Vector3 v) → void -
Sets
u
andv
to be two vectors orthogonal to each other andplaneNormal
. -
catmullRom(
double edge0, double edge1, double edge2, double edge3, double amount) → double -
Do a catmull rom spline interpolation with
edge0
,edge1
,edge2
andedge3
byamount
. -
cross2(
Vector2 x, Vector2 y) → double - 2D cross product. vec2 x vec2.
-
cross2A(
double x, Vector2 y, Vector2 out) → void - 2D cross product. double x vec2.
-
cross2B(
Vector2 x, double y, Vector2 out) → void - 2D cross product. vec2 x double.
-
cross3(
Vector3 x, Vector3 y, Vector3 out) → void - 3D Cross product.
-
degrees(
double radians) → double -
Convert
radians
to degrees. -
dot2(
Vector2 x, Vector2 y) → double - 2D dot product.
-
dot3(
Vector3 x, Vector3 y) → double - 3D dot product.
-
makeFrustumMatrix(
double left, double right, double bottom, double top, double near, double far) → Matrix4 - Constructs a new OpenGL perspective projection matrix.
-
makeInfiniteMatrix(
double fovYRadians, double aspectRatio, double zNear) → Matrix4 - Constructs a new OpenGL infinite projection matrix.
-
makeOrthographicMatrix(
double left, double right, double bottom, double top, double near, double far) → Matrix4 - Constructs a new OpenGL orthographic projection matrix.
-
makePerspectiveMatrix(
double fovYRadians, double aspectRatio, double zNear, double zFar) → Matrix4 - Constructs a new OpenGL perspective projection matrix.
-
makePlaneProjection(
Vector3 planeNormal, Vector3 planePoint) → Matrix4 -
Returns a transformation matrix that transforms points onto
the plane specified with
planeNormal
andplanePoint
. -
makePlaneReflection(
Vector3 planeNormal, Vector3 planePoint) → Matrix4 -
Returns a transformation matrix that transforms points by reflecting
them through the plane specified with
planeNormal
andplanePoint
. -
makeViewMatrix(
Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection) → Matrix4 - Constructs a new OpenGL view matrix.
-
mix(
double min, double max, double a) → double -
Interpolate between
min
andmax
with the amount ofa
using a linear interpolation. The computation is equivalent to the GLSL function mix. -
pickRay(
Matrix4 cameraMatrix, num viewportX, num viewportWidth, num viewportY, num viewportHeight, num pickX, num pickY, Vector3 rayNear, Vector3 rayFar) → bool -
On success,
rayNear
andrayFar
are the points where the screen spacepickX
,pickY
intersect with the near and far planes respectively. -
radians(
double degrees) → double -
Convert
degrees
to radians. -
relativeError(
dynamic calculated, dynamic correct) → double -
Returns relative error between
calculated
andcorrect
. The type ofcalculated
andcorrect
must match and can be any vector, matrix, or quaternion. -
setFrustumMatrix(
Matrix4 perspectiveMatrix, double left, double right, double bottom, double top, double near, double far) → void -
Constructs an OpenGL perspective projection matrix in
perspectiveMatrix
. -
setInfiniteMatrix(
Matrix4 infiniteMatrix, double fovYRadians, double aspectRatio, double zNear) → void -
Constructs an OpenGL infinite projection matrix in
infiniteMatrix
.fovYRadians
specifies the field of view angle, in radians, in the y direction.aspectRatio
specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio of x (width) to y (height).zNear
specifies the distance from the viewer to the near plane (always positive). -
setModelMatrix(
Matrix4 modelMatrix, Vector3 forwardDirection, Vector3 upDirection, double tx, double ty, double tz) → void -
Constructs an OpenGL model matrix in
modelMatrix
. Model transformation is the inverse of the view transformation. Model transformation is also known as "camera" transformation. Model matrix is commonly used to compute a object location/orientation into the full model-view stack. -
setOrthographicMatrix(
Matrix4 orthographicMatrix, double left, double right, double bottom, double top, double near, double far) → void -
Constructs an OpenGL orthographic projection matrix in
orthographicMatrix
. -
setPerspectiveMatrix(
Matrix4 perspectiveMatrix, double fovYRadians, double aspectRatio, double zNear, double zFar) → void -
Constructs an OpenGL perspective projection matrix in
perspectiveMatrix
. -
setRotationMatrix(
Matrix4 rotationMatrix, Vector3 forwardDirection, Vector3 upDirection) → void -
Constructs a rotation matrix in
rotationMatrix
. -
setViewMatrix(
Matrix4 viewMatrix, Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection) → void -
Constructs an OpenGL view matrix in
viewMatrix
. View transformation is the inverse of the model transformation. View matrix is commonly used to compute the camera location/orientation into the full model-view stack. -
smoothStep(
double edge0, double edge1, double amount) → double -
Do a smooth step (hermite interpolation) interpolation with
edge0
andedge1
byamount
. The computation is equivalent to the GLSL function smoothstep. -
unproject(
Matrix4 cameraMatrix, num viewportX, num viewportWidth, num viewportY, num viewportHeight, num pickX, num pickY, num pickZ, Vector3 pickWorld) → bool -
On success, Sets
pickWorld
to be the world space position of the screen spacepickX
,pickY
, andpickZ
.