<!-- ======================================================
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
====================================================== -->

<mujoco model="Dice">

    <body name="object" pos="-0.00 -0.02 0.24" user="1001 0 2003 27 0 0 0.06 0 0">
        <inertial pos="0 0 0" mass="0.05" diaginertia="6.48e-05 6.48e-05 6.48e-05" />

        <!-- 12 capsules, one for each edge (to get curved edges)-->
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" 0.0285 -.0285 -.0285  .0285 .0285 -.0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto="-.0285 -.0285 -.0285 -.0285 .0285 -.0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" -.0285 .0285 -.0285  .0285 .0285 -.0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" -.0285 -.0285 -.0285  .0285 -.0285 -.0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" .0285 -.0285 .0285 .0285 .0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto="-.0285 -.0285 .0285 -.0285 .0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" -.0285 .0285 .0285  .0285 .0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=" -.0285 -.0285 .0285  .0285 -.0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=".0285 -.0285 -.0285  .0285 -.0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto=".0285 .0285 -.0285  .0285 .0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto="-.0285 .0285 -.0285  -.0285 .0285 .0285" size=".0050"/>
        <geom pos='0 0 0' type="capsule" rgba='1 1 1 1' fromto="-.0285 -.0285 -.0285  -.0285 -.0285 .0285" size=".0050"/>

        <!-- 3 boxes, each one fills along one of the three axes-->
        <geom type="box" size="0.0334 0.0286 0.0286" material="MatDice"/>
        <geom type="box" size="0.0286 0.0334 0.0286" material="MatDice"/>
        <geom type="box" size="0.0286 0.0286 0.0334" material="MatDice"/>

        <joint name="OBJTx" pos="0 0 0" axis="1 0 0" type="slide" range="-.5 .5" damping="0.001" />
        <joint name="OBJTy" pos="0 0 0" axis="0 1 0" type="slide" range="-.5 .5" damping="0.001" />
        <joint name="OBJTz" pos="0 0 0" axis="0 0 1" type="slide" range="-.5 .5" damping="0.001" />
        <joint name="OBJRx" pos="0 0 0  " axis="1 0 0" limited="false" damping="0.001" />
        <joint name="OBJRy" pos="0 0 0" axis="0 1 0" limited="false" damping="0.001" />
        <joint name="OBJRz" pos="0 0 0" axis="0 0 1" limited="false" damping="0.001" />

        <site name="object_o" type="sphere" size="0.005" rgba="0.8 0.8 0.8 0.8" group="4" pos="0 0 0" />
        <site name="object_x" type="sphere" size="0.005" rgba="0.8 0.2 0.2 0.8" group="4" pos="0.028 0 0" />
        <site name="object_y" type="sphere" size="0.005" rgba="0.2 0.8 0.2 0.8" group="4" pos="0 .028 0" />
        <site name="object_z" type="sphere" size="0.005" rgba="0.2 0.2 0.8 0.8" group="4" pos="0 0 .028" />

        <!--visualize axes-->
        <site type='cylinder' size='.003 .05' pos='0 0 .05' rgba='1 0 0 .5'/>
        <site type='cylinder' size='.003 .05' pos='.05 0 0' rgba='0 1 0 .5' euler='0 1.57 0'/>
        <site type='cylinder' size='.003 .05' pos='0 .05 0' rgba='0 0 1 .5' euler='1.57 0 0'/>

    </body>

    <body name="target" pos="0 0.2 0.25" >

        <geom name="target_dice" type="box" size="0.026 0.026 0.026" contype="0" conaffinity="0" material="MatDice" rgba='1 1 1 .3'/>
        <site name="target_ball" type="sphere" size="0.07" rgba="0.2 0.7 0.2 0.1"/>
        <site name="target_o" type="sphere" size="0.005" rgba="0.8 0.8 0.8 0.8" group="4" pos="0 0 0" />
        <site name="target_x" type="sphere" size="0.005" rgba="0.8 0.2 0.2 0.8" group="4" pos="0.03 0 0" />
        <site name="target_y" type="sphere" size="0.005" rgba="0.2 0.8 0.2 0.8" group="4" pos="0 .03 0" />
        <site name="target_z" type="sphere" size="0.005" rgba="0.2 0.2 0.8 0.8" group="4" pos="0 0 .03" />

        <!-- visualize axes -->
        <site type='cylinder' size='.003 .05' pos='0 0 .05' rgba='1 0 0 .5'/>
        <site type='cylinder' size='.003 .05' pos='.05 0 0' rgba='0 1 0 .5' euler='0 1.57 0'/>
        <site type='cylinder' size='.003 .05' pos='0 .05 0' rgba='0 0 1 .5' euler='1.57 0 0'/>


        <joint name="targetRx" pos="0 0 0" axis="1 0 0" limited="false" damping="0.001" />
        <joint name="targetRy" pos="0 0 0" axis="0 1 0" limited="false" damping="0.001" />
        <joint name="targetRz" pos="0 0 0" axis="0 0 1" limited="false" damping="0.001" />
    </body>

 </mujoco>