warp.mesh\_get\_velocity ======================== .. function:: warp._src.lang.mesh_get_velocity(id: uint64, index: int32) -> vec3f .. hlist:: :columns: 8 * Kernel Look up the velocity of a face's vertex in the :class:`warp.Mesh`. Like :func:`mesh_get_point`, ``index`` is a *face-vertex index* in ``[0, 3 * number_of_faces)``; returns the velocity of the vertex referenced there, i.e. ``velocities[indices[index]]``. Requires the mesh to have been constructed with a ``velocities`` array; returns a zero vector otherwise. :param id: The mesh identifier :param index: A face-vertex index, in ``[0, 3 * number_of_faces)`` :returns: The referenced vertex's velocity, or a zero vector if the mesh has no velocities. .. rubric:: Example .. testcode:: @wp.kernel def slot0(mesh_id: wp.uint64, out: wp.array[wp.vec3]): out[0] = wp.mesh_get_velocity(mesh_id, 0) points = wp.array([[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]], dtype=wp.vec3) indices = wp.array([0,3,2, 0,2,1, 4,5,6, 4,6,7, 0,1,5, 0,5,4, 2,3,7, 2,7,6, 0,4,7, 0,7,3, 1,2,6, 1,6,5], dtype=wp.int32) velocities = wp.array(np.tile([0.0, 0.0, 1.0], (8, 1)), dtype=wp.vec3) mesh = wp.Mesh(points=points, indices=indices, velocities=velocities) out = wp.zeros(1, dtype=wp.vec3) wp.launch(slot0, dim=1, inputs=[mesh.id], outputs=[out]) print(out.numpy()[0]) .. testoutput:: [0. 0. 1.]