/** Sets the specified value to the {@code r} field. */ public AIColor4D r(float value) { nr(address(), value); return this; } /** Sets the specified value to the {@code g} field. */
/** Returns the value of the {@code g} field. */ public float g() { return ng(address()); } /** Returns the value of the {@code b} field. */
/** Sets the specified value to the {@code b} field. */ public AIColor4D b(float value) { nb(address(), value); return this; } /** Sets the specified value to the {@code a} field. */
/** Returns the value of the {@code r} field. */ public float r() { return nr(address()); } /** Returns the value of the {@code g} field. */
/** Sets the specified value to the {@code g} field. */ public AIColor4D g(float value) { ng(address(), value); return this; } /** Sets the specified value to the {@code b} field. */
/** Returns the value of the {@code b} field. */ public float b() { return nb(address()); } /** Returns the value of the {@code a} field. */
/** Sets the specified value to the {@code a} field. */ public AIColor4D a(float value) { na(address(), value); return this; }
/** Returns the value of the {@code a} field. */ public float a() { return na(address()); }
/** * Retrieve a color value with a specific key from a material. * * @param pMat Pointer to the input material. May not be {@code NULL} * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. * @param type Specifies the type of the texture to be retrieved. One of:<br><table><tr><td>{@link #aiTextureType_NONE TextureType_NONE}</td><td>{@link #aiTextureType_DIFFUSE TextureType_DIFFUSE}</td><td>{@link #aiTextureType_SPECULAR TextureType_SPECULAR}</td><td>{@link #aiTextureType_AMBIENT TextureType_AMBIENT}</td></tr><tr><td>{@link #aiTextureType_EMISSIVE TextureType_EMISSIVE}</td><td>{@link #aiTextureType_HEIGHT TextureType_HEIGHT}</td><td>{@link #aiTextureType_NORMALS TextureType_NORMALS}</td><td>{@link #aiTextureType_SHININESS TextureType_SHININESS}</td></tr><tr><td>{@link #aiTextureType_OPACITY TextureType_OPACITY}</td><td>{@link #aiTextureType_DISPLACEMENT TextureType_DISPLACEMENT}</td><td>{@link #aiTextureType_LIGHTMAP TextureType_LIGHTMAP}</td><td>{@link #aiTextureType_REFLECTION TextureType_REFLECTION}</td></tr><tr><td>{@link #aiTextureType_UNKNOWN TextureType_UNKNOWN}</td></tr></table> * @param index Index of the texture to be retrieved. * @param pOut Pointer to a color to receive the result. * * @return Specifies whether the key has been found. If not, the output struct remains unmodified. */ @NativeType("aiReturn") public static int aiGetMaterialColor(@NativeType("struct aiMaterial const *") AIMaterial pMat, @NativeType("char const *") ByteBuffer pKey, @NativeType("unsigned int") int type, @NativeType("unsigned int") int index, @NativeType("struct aiColor4D *") AIColor4D pOut) { if (CHECKS) { checkNT1(pKey); } return naiGetMaterialColor(pMat.address(), memAddress(pKey), type, index, pOut.address()); }
/** * Retrieve a color value with a specific key from a material. * * @param pMat Pointer to the input material. May not be {@code NULL} * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. * @param type Specifies the type of the texture to be retrieved. One of:<br><table><tr><td>{@link #aiTextureType_NONE TextureType_NONE}</td><td>{@link #aiTextureType_DIFFUSE TextureType_DIFFUSE}</td><td>{@link #aiTextureType_SPECULAR TextureType_SPECULAR}</td><td>{@link #aiTextureType_AMBIENT TextureType_AMBIENT}</td></tr><tr><td>{@link #aiTextureType_EMISSIVE TextureType_EMISSIVE}</td><td>{@link #aiTextureType_HEIGHT TextureType_HEIGHT}</td><td>{@link #aiTextureType_NORMALS TextureType_NORMALS}</td><td>{@link #aiTextureType_SHININESS TextureType_SHININESS}</td></tr><tr><td>{@link #aiTextureType_OPACITY TextureType_OPACITY}</td><td>{@link #aiTextureType_DISPLACEMENT TextureType_DISPLACEMENT}</td><td>{@link #aiTextureType_LIGHTMAP TextureType_LIGHTMAP}</td><td>{@link #aiTextureType_REFLECTION TextureType_REFLECTION}</td></tr><tr><td>{@link #aiTextureType_UNKNOWN TextureType_UNKNOWN}</td></tr></table> * @param index Index of the texture to be retrieved. * @param pOut Pointer to a color to receive the result. * * @return Specifies whether the key has been found. If not, the output struct remains unmodified. */ @NativeType("aiReturn") public static int aiGetMaterialColor(@NativeType("struct aiMaterial const *") AIMaterial pMat, @NativeType("char const *") CharSequence pKey, @NativeType("unsigned int") int type, @NativeType("unsigned int") int index, @NativeType("struct aiColor4D *") AIColor4D pOut) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { stack.nASCII(pKey, true); long pKeyEncoded = stack.getPointerAddress(); return naiGetMaterialColor(pMat.address(), pKeyEncoded, type, index, pOut.address()); } finally { stack.setPointer(stackPointer); } }