public class SoInstanceParameter extends SoVertexShaderParameterBufferObject
SoBufferObject. It is used with the SoMultipleInstance node.
Some predefined parameter names can be used for common instance parameters like position, rotation and scale factor. Parameter objects with these names are automatically managed and are recognized and used by the default shaders. Applications can define additional parameter objects to be used by custom shaders.
See the base classes SoShaderParameter, SoVertexShaderParameter and SoVertexShaderParameterBufferObject for more details.
Note: Unlike SoVertexShaderParameter, instances of this node must be added to the
parameters field of an SoMultipleInstance node, not directly in the scene graph.
File format/default:
InstanceParameter {
| name | "" |
| identifier | 0 |
| value | NULL |
| components | 4 |
| type | SbDataType.FLOAT |
| stride | 0 |
| shouldBeNormalized | false |
| divisor | 1 |
See also:
SoVertexShaderParameter, SoVertexShaderParameterBufferObject, SoMultipleInstance
| Modifier and Type | Class and Description |
|---|---|
static class |
SoInstanceParameter.PredefinedParameters
List of predefined per-instance attribute names.
|
Inventor.ConstructorCommand| Modifier and Type | Field and Description |
|---|---|
static int |
COLOR
Deprecated.
Use
SoInstanceParameter.PredefinedParameters.COLOR instead. |
SoSFUInt32 |
divisor
This field modifies the rate at which values advance during multiple instance rendering.
|
static int |
NUM_PREDEFINED_PARAMETERS
Deprecated.
|
static int |
ROTATION
Deprecated.
Use
SoInstanceParameter.PredefinedParameters.ROTATION instead. |
static int |
SCALE
Deprecated.
Use
SoInstanceParameter.PredefinedParameters.SCALE instead. |
static int |
TRANSLATION
Deprecated.
Use
SoInstanceParameter.PredefinedParameters.TRANSLATION instead. |
static int |
VISIBILITY
Deprecated.
Use
SoInstanceParameter.PredefinedParameters.VISIBILITY instead. |
components, offset, shouldBeNormalized, stride, type, valueidentifier, nameVERBOSE_LEVEL, ZeroHandle| Constructor and Description |
|---|
SoInstanceParameter()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static SoInstanceParameter |
createPredefinedParameter(SoInstanceParameter.PredefinedParameters paramKey,
SoBufferObject values)
Calls createPredefinedParameter(paramKey, values, (int)1).
|
static SoInstanceParameter |
createPredefinedParameter(SoInstanceParameter.PredefinedParameters paramKey,
SoBufferObject values,
int divisor)
Creates an instance parameter object for one of the predefined attribute names.
|
static java.lang.String |
getPredefinedParameterName(SoInstanceParameter.PredefinedParameters paramKey)
Returns the predefined instance parameter name for the specified paramKey.
|
void |
setPredefinedParameterName(SoInstanceParameter.PredefinedParameters paramKey)
Sets the
name field to the string corresponding to the given paramKey. |
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, writecopyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsdispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizablegetAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads@Deprecated public static final int TRANSLATION
SoInstanceParameter.PredefinedParameters.TRANSLATION instead.@Deprecated public static final int ROTATION
SoInstanceParameter.PredefinedParameters.ROTATION instead.@Deprecated public static final int SCALE
SoInstanceParameter.PredefinedParameters.SCALE instead.@Deprecated public static final int VISIBILITY
SoInstanceParameter.PredefinedParameters.VISIBILITY instead.@Deprecated public static final int COLOR
SoInstanceParameter.PredefinedParameters.COLOR instead.@Deprecated public static final int NUM_PREDEFINED_PARAMETERS
SoInstanceParameter.PredefinedParameters.NUM_PREDEFINED_PARAMETERS instead.public final SoSFUInt32 divisor
public static SoInstanceParameter createPredefinedParameter(SoInstanceParameter.PredefinedParameters paramKey, SoBufferObject values)
public void setPredefinedParameterName(SoInstanceParameter.PredefinedParameters paramKey)
name field to the string corresponding to the given paramKey.public static java.lang.String getPredefinedParameterName(SoInstanceParameter.PredefinedParameters paramKey)
public static SoInstanceParameter createPredefinedParameter(SoInstanceParameter.PredefinedParameters paramKey, SoBufferObject values, int divisor)
SoBufferObject. The SoBufferObject is expected to contain translations encoded as 3 float values, e.g. array of SbVec3f. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a translation value is shared.
Example :
paramKey = ROTATION:
Sets the rotation per instance parameter values using the specified SoBufferObject. The SoBufferObject is expected to contain rotations encoded as 4 float values, e.g. array of SbRotation. The buffer size must be at least (numInstances/divisor) * 4 * sizeof(float). The divisor parameter indicates by how many instances a rotation value is shared.
paramKey = SCALE:
Sets the scaling per instance parameter values using the specified SoBufferObject. The SoBufferObject is expected to contain scaling factor encoded as 3 float values, e.g. array of SbVec3f. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a scale value is shared.
paramKey = COLOR:
Sets the color per instance parameter values using the specified SoBufferObject. The SoBufferObject is expected to contain colors encoded as 3 float values, e.g. array of SbColor. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a color value is shared.
paramKey = VISIBILITY:
Sets the visibility per instance parameter values using the specified SoBufferObject. The SoBufferObject is expected to contain visibility value encoded as an int32_t value. The buffer size must be at least (numInstances/divisor) * sizeof(int32_t). The divisor parameter indicates by how many instances a visibility value is shared.
Generated on July 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com