Go to the source code of this file.
Classes | |
struct | OivASRay |
Structure for parameters of the ray. More... | |
struct | OivASPoint |
Structure containing information about the the raycast intersection point. More... | |
Functions | |
bool | OivASSolveQuadric (in vec3 abc, inout vec2 roots) |
bool | OivASRayPlaneIntersection (in OivASRay ray, in vec4 plane, inout float t) |
vec4 | OivASGetColor () |
float | OivASGetOpacity () |
bool | OivASIsOpaque () |
void | OivASVertexShaderEntry () |
vec4 | OivASComputeColor (in OivASPoint p) |
bool | OivASRayIntersection (in OivASRay ray, inout OivASPoint p) |
vec4 OivASComputeColor | ( | in OivASPoint | p | ) |
[Slot] COMPUTE_COLOR Returns the color of the fragment.
Note that for shading facilities, the position, normal and color of the fragment are filled in the input parameter 'p'.
vec4 OivASGetColor | ( | ) |
Returns the color (i.e.
from material or vertex color) of the shape.
float OivASGetOpacity | ( | ) |
Returns the opacity (i.e.
alpha component) of the shape.
bool OivASIsOpaque | ( | ) |
Returns true if the shape is opaque (i.e.
OivASGetOpacity() == 1.0).
bool OivASRayIntersection | ( | in OivASRay | ray, | |
inout OivASPoint | p | |||
) |
[Slot] rayIntersection Computes the intersection between ray and shape.
* ray: ray parameters * p: structure containing the intersection point position (if any), normal (if any) and color (if any) * return true if there is intersection, false otherwise
Note that all positions and directions are defined in the space specified in the constructor of the SoAlgebraicShape node. The default one is the local frame coordinate centered at (0,0,0) with bounding box coordinates between -1.0 and 1.0.
For example, for a sphere, we consider in this function that the sphere has a radius of 1.0, centered at the origin.
bool OivASRayPlaneIntersection | ( | in OivASRay | ray, | |
in vec4 | plane, | |||
inout float | t | |||
) |
If 'ray' intersects 'plane', returns true and sets location of intersection in 't'.
Plane is defined by four values 'xyzw', where 'xyz' is the normal vector and 'w' is the distance from the origin (i.e. the point p.w*p.xyz lies on the plane).
bool OivASSolveQuadric | ( | in vec3 | abc, | |
inout vec2 | roots | |||
) |
Helper function to solve quadric of type -> a*x*x + b*x + c = 0.
Returns true if there are roots, stored in 'roots' vector. Note that it can be used in fragment shader only.
void OivASVertexShaderEntry | ( | ) |
[Slot] VERTEX_SHADER_ENTRY Defines actions from the vertex shader such as initialize varying parameters from vertex attribute and so on.