示例#1
0
文件: shape.py 项目: JanS97/PyRep
    def set_opacity(self, opacity: float) -> None:
        """Sets the opacity of the shape.

        :param color: The opacity of the shape (0: transparent, 1: opaque).
        :return:
        """
        sim.simSetShapeColor(self._handle, None,
                             sim.sim_colorcomponent_transparency, [opacity])
示例#2
0
文件: shape.py 项目: JanS97/PyRep
    def set_color(self, color: List[float]) -> None:
        """Sets the color of the shape.

        :param color: The r, g, b values of the shape.
        :return:
        """
        sim.simSetShapeColor(self._handle, None,
                             sim.sim_colorcomponent_ambient_diffuse, color)
示例#3
0
    def set_transparency(self, value: float) -> None:
        """Sets the transparency of the shape.

        :param value: Value between 0 and 1.
        """
        if 0 > value > 1:
            raise ValueError('Value must be between 0 and 1.')
        sim.simSetShapeColor(self._handle, None,
                             sim.sim_colorcomponent_transparency, [value])
示例#4
0
    def set_transparency(object, value):
        """set object transparency

    Args:
        object (Shape): [PyRep Shape class]
        value (list): [list of 1 value] 0 ~ 1
    """
        sim.simSetShapeColor(object.get_handle(), None,
                             sim.sim_colorcomponent_transparency, value)
示例#5
0
    def set_emission_color(object, color):
        """set object emission color

    Args:
        object (Shape): [PyRep Shape class]
        color (list): [3 value of rgb] 0 ~ 1
    """
        sim.simSetShapeColor(object.get_handle(), None,
                             sim.sim_colorcomponent_emission, color)
示例#6
0
 def _randomize_object_color(object_handle: int):
     color = list(np.random.uniform(low=0.0, high=1.0, size=(3, )))
     sim.simSetShapeColor(object_handle, None,
                          sim.sim_colorcomponent_ambient_diffuse, color)