def attach_to_world(self, parent_node_path: NodePath, physics_world: PhysicsWorld):
        """
        Load the object to the world from memory, attach the object to the scene graph.
        Args:
            parent_node_path: which parent node to attach
            physics_world: PhysicsWorld, engine.physics_world

        Returns: None

        """
        if not self.is_attached():
            assert isinstance(self.origin, NodePath), "No render model on node_path in this Element"
            self.origin.reparentTo(parent_node_path)
            self.dynamic_nodes.attach_to_physics_world(physics_world.dynamic_world)
            self.static_nodes.attach_to_physics_world(physics_world.static_world)
            logger.debug("{} is attached to the world.".format(self.class_name))
        else:
            logger.debug("Can not attach object {} to world, as it is already attached!".format(self.class_name))

        Load the object to the world from memory, attach the object to the scene graph.
        Args:
            parent_node_path: which parent node to attach
            physics_world: PhysicsWorld, engine.physics_world

        Returns: None

        
metadrive/base_class/base_object.py