Light

Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.SceneObject, com.aspose.threed.Entity, com.aspose.threed.Frustum

public class Light extends Frustum

光照亮场景。

计算光的总衰减的公式为: A = ConstantAttenuation + (Dist * LinearAttenuation) + ((Dist^2) * QuadraticAttenuation)

构造函数

构造函数描述
Light()初始化 Light 类的新实例。
Light(String name)初始化 Light 类的新实例。
Light(String name, LightType type)初始化 Light 类的新实例。

方法

方法描述
equals(Object arg0)
findProperty(String propertyName)查找属性。
getAspect()获取视锥体的宽高比。
getBoundingBox()获取当前实体在其对象空间坐标系中的边界框。
getCastLight()获取当前光实例是否可以照亮其他对象。
getCastShadows()获取光是否可以在其他对象上投射阴影。
getClass()
getColor()获取光的颜色。
getConstantAttenuation()获取用于计算光的总衰减的常数衰减。
getDirection()获取相机所看的方向。
getEntityRendererKey()获取在渲染器中注册的实体渲染器的键
getExcluded()获取在导出期间是否排除此实体。
getFalloff()获取衰减锥角(单位:度)。
getFarPlane()获取视锥体的远平面距离。
getHotSpot()获取热点锥角(单位为度)。
getIntensity()获取光的强度,默认值为 100
getLightType()获取光的类型
getLinearAttenuation()获取线性衰减,以计算光的总衰减
getLookAt()获取相机所关注的位置。
getName()获取名称。
getNearPlane()获取视锥体的近裁剪面距离。
getOrthoHeight()获取视锥体在正交投影时的高度。
getParentNode()获取第一个父节点,如果设置第一个父节点,则此实体将从其他父节点分离。
getParentNodes()获取所有父节点,实体可以附加到多个父节点以进行几何实例化
getProperties()获取所有属性的集合。
getProperty(String property)获取指定属性的值
getQuadraticAttenuation()获取二次衰减,以计算光的总衰减
getRotationMode()获取视锥体的方向模式。此属性仅在 getTarget 为 null 时有效。
getScene()获取此对象所属的场景
getShadowColor()获取阴影的颜色。
getTarget()获取相机所看的目标。
getUp()获取相机的上方向
hashCode()
notify()
notifyAll()
removeProperty(Property property)移除动态属性。
removeProperty(String property)移除通过名称标识的指定属性
setAspect(double value)设置视锥体的宽高比
setCastLight(boolean value)设置当前光实例是否可以照亮其他对象。
setCastShadows(boolean value)设置光是否可以在其他对象上投射阴影。
setColor(Vector3 value)设置光的颜色
setConstantAttenuation(double value)设置常数衰减,以计算光的总衰减。
setDirection(Vector3 value)设置相机所看的方向。
setExcluded(boolean value)设置在导出期间是否排除此实体。
setFalloff(double value)设置衰减锥角(单位为度)。
setFarPlane(double value)设置视锥体的远裁剪面距离。
setHotSpot(double value)设置热点锥角(单位为度)。
setIntensity(double value)设置光的强度,默认值为 100
setLightType(LightType value)设置光的类型
setLinearAttenuation(double value)设置线性衰减,以计算光的总衰减
setLookAt(Vector3 value)设置相机所关注的位置。
setName(String value)设置名称。
setNearPlane(double value)设置视锥体的近裁剪面距离。
setOrthoHeight(double value)设置视锥体在正交投影时的高度。
setParentNode(Node value)设置第一个父节点,如果设置第一个父节点,则此实体将从其他父节点分离。
setProperty(String property, Object value)设置指定属性的值
setQuadraticAttenuation(double value)设置二次衰减以计算光的总衰减
setRotationMode(RotationMode value)设置视锥体的方向模式。此属性仅在 getTarget 为 null 时有效。
setShadowColor(Vector3 value)设置阴影的颜色。
setTarget(Node value)设置相机所看的目标。
setUp(Vector3 value)设置相机的上方向
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

Light()

public Light()

初始化 Light 类的新实例。

Light(String name)

public Light(String name)

初始化 Light 类的新实例。

Parameters:

参数类型描述
名称java.lang.String名称

Light(String name, LightType type)

public Light(String name, LightType type)

初始化 Light 类的新实例。

Parameters:

参数类型描述
名称java.lang.String名称
typeLightType新光源的类型

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: 布尔

findProperty(String propertyName)

public Property findProperty(String propertyName)

查找属性。它可以是动态属性(由 CreateDynamicProperty/SetProperty 创建)或本机属性(通过其名称标识)

Parameters:

参数类型描述
propertyNamejava.lang.String属性名称。

Returns: Property - The property.

getAspect()

public double getAspect()

获取视锥体的宽高比。

Returns: double - 视锥体的宽高比

getBoundingBox()

public BoundingBox getBoundingBox()

获取当前实体在其对象空间坐标系中的边界框。

Returns: BoundingBox - the bounding box of current entity in its object space coordinate system. Example: The following code shows how to calculate the bounding box of a shape

Entity entity = new Sphere();
     entity.setRadius(10);
     var bbox = entity.getBoundingBox();
     System.out.printf("The bounding box of the entity is %s ~ %s", bbox.getMinimum(), bbox.getMaximum());

getCastLight()

public boolean getCastLight()

获取当前光实例是否可以照亮其他对象。

Returns: boolean - 当前光实例是否可以照亮其他对象。

getCastShadows()

public boolean getCastShadows()

获取光是否可以在其他对象上投射阴影。

Returns: boolean - 光是否可以在其他对象上投射阴影。

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor()

public Vector3 getColor()

获取光的颜色。

Returns: Vector3 - the light’s color

getConstantAttenuation()

public double getConstantAttenuation()

获取用于计算光的总衰减的常数衰减。

Returns: double - 用于计算光总衰减的常数衰减

getDirection()

public Vector3 getDirection()

获取相机所看的方向。对此属性的更改也会影响 getLookAtgetTarget

Returns: Vector3 - the direction that the camera is looking at. Changes on this property will also affects the getLookAt and getTarget.

getEntityRendererKey()

public EntityRendererKey getEntityRendererKey()

获取在渲染器中注册的实体渲染器的键

Returns: EntityRendererKey - the key of the entity renderer registered in the renderer

getExcluded()

public boolean getExcluded()

获取在导出期间是否排除此实体。

Returns: boolean - 是否在导出期间排除此实体。

getFalloff()

public double getFalloff()

获取衰减锥角(单位:度)。

Returns: double - 衰减锥角(以度为单位)。

getFarPlane()

public double getFarPlane()

获取视锥体的远平面距离。

Returns: double - 视锥体的远裁剪面距离。

getHotSpot()

public double getHotSpot()

获取热点锥角(单位为度)。

Returns: double - 热点锥角(以度为单位)。

getIntensity()

public double getIntensity()

获取光的强度,默认值为 100

Returns: double - 光的强度,默认值为 100

getLightType()

public LightType getLightType()

获取光的类型

Returns: LightType - the light’s type

getLinearAttenuation()

public double getLinearAttenuation()

获取线性衰减,以计算光的总衰减

Returns: double - 用于计算光总衰减的线性衰减

getLookAt()

public Vector3 getLookAt()

获取相机所关注的位置。

Returns: Vector3 - the the interested position that the camera is looking at.

getName()

public String getName()

获取名称。

Returns: java.lang.String - 名称。

getNearPlane()

public double getNearPlane()

获取视锥体的近裁剪面距离。

Returns: double - 视锥体的近裁剪面距离。

getOrthoHeight()

public double getOrthoHeight()

获取视锥体在正交投影时的高度。

Returns: double - 视锥体在正交投影时的高度。

getParentNode()

public Node getParentNode()

获取第一个父节点,如果设置第一个父节点,则此实体将从其他父节点分离。

Returns: Node - the first parent node, if set the first parent node, this entity will be detached from other parent nodes.

getParentNodes()

public ArrayList<Node> getParentNodes()

获取所有父节点,实体可以附加到多个父节点以进行几何实例化

Returns: java.util.ArrayList<com.aspose.threed.Node> - 所有父节点,实体可以附加到多个父节点以实现几何实例化

getProperties()

public PropertyCollection getProperties()

获取所有属性的集合。

Returns: PropertyCollection - the collection of all properties.

getProperty(String property)

public Object getProperty(String property)

获取指定属性的值

Parameters:

参数类型描述
属性java.lang.String属性名称

Returns: java.lang.Object - 找到的属性的值

getQuadraticAttenuation()

public double getQuadraticAttenuation()

获取二次衰减,以计算光的总衰减

Returns: double - 用于计算光总衰减的二次衰减

getRotationMode()

public RotationMode getRotationMode()

获取视锥体的方向模式。此属性仅在 getTarget 为 null 时有效。如果值为 RotationMode.FIXED_TARGET,方向始终由属性 getLookAt 计算;否则 getLookAt 始终由 getDirection 计算。

Returns: RotationMode - the frustum’s orientation mode This property only works when the getTarget is null. If the value is RotationMode.FIXED_TARGET, the direction is always calculated by the property getLookAt Otherwise the getLookAt is always calculated by the getDirection

getScene()

public Scene getScene()

获取此对象所属的场景

Returns: Scene - the scene that this object belongs to

getShadowColor()

public Vector3 getShadowColor()

获取阴影的颜色。

Returns: Vector3 - the shadow’s color.

getTarget()

public Node getTarget()

获取相机所看的目标。如果用户支持此属性,它应在 getLookAt 属性之前。

Returns: Node - the target that the camera is looking at. If the user supports this property, it should be prior to getLookAt property.

getUp()

public Vector3 getUp()

获取相机的上方向

Returns: Vector3 - the up direction of the camera

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeProperty(Property property)

public boolean removeProperty(Property property)

移除动态属性。

Parameters:

参数类型描述
propertyProperty要删除哪个属性

Returns: boolean - 如果属性成功删除则为 true

removeProperty(String property)

public boolean removeProperty(String property)

移除通过名称标识的指定属性

Parameters:

参数类型描述
属性java.lang.String要删除哪个属性

Returns: boolean - 如果属性成功删除则为 true

setAspect(double value)

public void setAspect(double value)

设置视锥体的宽高比

Parameters:

参数类型描述
double新值

setCastLight(boolean value)

public void setCastLight(boolean value)

设置当前光实例是否可以照亮其他对象。

Parameters:

参数类型描述
布尔新值

setCastShadows(boolean value)

public void setCastShadows(boolean value)

设置光是否可以在其他对象上投射阴影。

Parameters:

参数类型描述
布尔新值

setColor(Vector3 value)

public void setColor(Vector3 value)

设置光的颜色

Parameters:

参数类型描述
valueVector3新值

setConstantAttenuation(double value)

public void setConstantAttenuation(double value)

设置常数衰减,以计算光的总衰减。

Parameters:

参数类型描述
double新值

setDirection(Vector3 value)

public void setDirection(Vector3 value)

设置相机所看的方向。对此属性的更改也会影响 getLookAtgetTarget

Parameters:

参数类型描述
valueVector3新值

setExcluded(boolean value)

public void setExcluded(boolean value)

设置在导出期间是否排除此实体。

Parameters:

参数类型描述
布尔新值

setFalloff(double value)

public void setFalloff(double value)

设置衰减锥角(单位为度)。

Parameters:

参数类型描述
double新值

setFarPlane(double value)

public void setFarPlane(double value)

设置视锥体的远裁剪面距离。

Parameters:

参数类型描述
double新值

setHotSpot(double value)

public void setHotSpot(double value)

设置热点锥角(单位为度)。

Parameters:

参数类型描述
double新值

setIntensity(double value)

public void setIntensity(double value)

设置光的强度,默认值为 100

Parameters:

参数类型描述
double新值

setLightType(LightType value)

public void setLightType(LightType value)

设置光的类型

Parameters:

参数类型描述
valueLightType新值

setLinearAttenuation(double value)

public void setLinearAttenuation(double value)

设置线性衰减,以计算光的总衰减

Parameters:

参数类型描述
double新值

setLookAt(Vector3 value)

public void setLookAt(Vector3 value)

设置相机所关注的位置。

Parameters:

参数类型描述
valueVector3新值

setName(String value)

public void setName(String value)

设置名称。

Parameters:

参数类型描述
java.lang.String新值

setNearPlane(double value)

public void setNearPlane(double value)

设置视锥体的近裁剪面距离。

Parameters:

参数类型描述
double新值

setOrthoHeight(double value)

public void setOrthoHeight(double value)

设置视锥体在正交投影时的高度。

Parameters:

参数类型描述
double新值

setParentNode(Node value)

public void setParentNode(Node value)

设置第一个父节点,如果设置第一个父节点,则此实体将从其他父节点分离。

Parameters:

参数类型描述
valueNode新值

setProperty(String property, Object value)

public void setProperty(String property, Object value)

设置指定属性的值

Parameters:

参数类型描述
属性java.lang.String属性名称
java.lang.Object属性的值

setQuadraticAttenuation(double value)

public void setQuadraticAttenuation(double value)

设置二次衰减以计算光的总衰减

Parameters:

参数类型描述
double新值

setRotationMode(RotationMode value)

public void setRotationMode(RotationMode value)

设置视锥体的方向模式。此属性仅在 getTarget 为 null 时有效。如果值为 RotationMode.FIXED_TARGET,方向始终由属性 getLookAt 计算;否则 getLookAt 始终由 getDirection 计算。

Parameters:

参数类型描述
valueRotationMode新值

setShadowColor(Vector3 value)

public void setShadowColor(Vector3 value)

设置阴影的颜色。

Parameters:

参数类型描述
valueVector3新值

setTarget(Node value)

public void setTarget(Node value)

设置相机所看的目标。如果用户支持此属性,则应在 getLookAt 属性之前设置。

Parameters:

参数类型描述
valueNode新值

setUp(Vector3 value)

public void setUp(Vector3 value)

设置相机的上方向

Parameters:

参数类型描述
valueVector3新值

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

参数类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

参数类型描述
arg0long
arg1int