physx_utils
bind_material(prim_path, material_path)
Binds material located at @material_path to the prim located at @prim_path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prim_path
|
str
|
Stage path to prim to bind material to |
required |
material_path
|
str
|
Stage path to material to be bound |
required |
Source code in omnigibson/utils/physx_utils.py
create_physx_particle_system(prim_path, physics_scene_path, particle_contact_offset, visual_only=False, smoothing=True, anisotropy=True, isosurface=True)
Creates an Omniverse physx particle system at @prim_path. For post-processing visualization effects (anisotropy, smoothing, isosurface), see the Omniverse documentation (https://docs.omniverse.nvidia.com/app_create/prod_extensions/ext_physics.html?highlight=isosurface#post-processing-for-fluid-rendering) for more info
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prim_path
|
str
|
Stage path to where particle system should be created |
required |
physics_scene_path
|
str
|
Stage path to where active physicsScene prim is defined |
required |
particle_contact_offset
|
float
|
Distance between particles which triggers a collision (m) |
required |
visual_only
|
bool
|
If True, will disable collisions between particles and non-particles, as well as self-collisions |
False
|
smoothing
|
bool
|
Whether to smooth particle positions or not |
True
|
anisotropy
|
bool
|
Whether to apply anisotropy post-processing when visualizing particles. Stretches generated particles in order to make the particle cluster surface appear smoother. Useful for fluids |
True
|
isosurface
|
bool
|
Whether to apply isosurface mesh to visualize particles. Uses a monolithic surface that can have materials attached to it, useful for visualizing fluids |
True
|
Returns:
Type | Description |
---|---|
PhysxParticleSystem
|
Generated particle system prim |
Source code in omnigibson/utils/physx_utils.py
create_physx_particleset_pointinstancer(name, particle_system_path, physx_particle_system_path, prototype_prim_paths, particle_group, positions, self_collision=True, fluid=False, particle_mass=None, particle_density=None, orientations=None, velocities=None, angular_velocities=None, scales=None, prototype_indices=None, enabled=True)
Creates a particle set instancer based on a UsdGeom.PointInstancer at @prim_path on the current stage, with the specified parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name for this point instancer |
required |
particle_system_path
|
str
|
Stage path to particle system (Scope) |
required |
physx_particle_system_path
|
str
|
Stage path to physx particle system (PhysxParticleSystem) |
required |
prototype_prim_paths
|
list of str
|
Stage path(s) to the prototypes to reference for this particle set. |
required |
particle_group
|
int
|
ID for this particle set. Particles from different groups will automatically collide with each other. Particles in the same group will have collision behavior dictated by @self_collision |
required |
positions
|
list of 3-tuple or th.tensor
|
Particle (x,y,z) positions either as a list or a (N, 3) numpy array |
required |
self_collision
|
bool
|
Whether to enable particle-particle collision within the set (as defined by @particle_group) or not |
True
|
fluid
|
bool
|
Whether to simulated the particle set as fluid or not |
False
|
particle_mass
|
None or float
|
If specified, should be per-particle mass. Otherwise, will be inferred from @density. Note: Either @particle_mass or @particle_density must be specified! |
None
|
particle_density
|
None or float
|
If specified, should be per-particle density and is used to compute total point set mass. Otherwise, will be inferred from @density. Note: Either @particle_mass or @particle_density must be specified! |
None
|
orientations
|
None or list of 4-array or th.tensor
|
Particle (x,y,z,w) quaternion orientations, either as a list or a (N, 4) numpy array. If not specified, all will be set to canonical orientation (0, 0, 0, 1) |
None
|
velocities
|
None or list of 3-array or th.tensor
|
Particle (x,y,z) velocities either as a list or a (N, 3) numpy array. If not specified, all will be set to 0 |
None
|
angular_velocities
|
None or list of 3-array or th.tensor
|
Particle (x,y,z) angular velocities either as a list or a (N, 3) numpy array. If not specified, all will be set to 0 |
None
|
scales
|
None or list of 3-array or th.tensor
|
Particle (x,y,z) scales either as a list or a (N, 3) numpy array. If not specified, all will be set to 1.0 |
None
|
prototype_indices
|
None or list of int
|
If specified, should specify which prototype should be used for each particle. If None, will use all 0s (i.e.: the first prototype created) |
None
|
enabled
|
bool
|
Whether to enable this particle instancer. If not enabled, then no physics will be used |
True
|
Returns:
Type | Description |
---|---|
PointInstancer
|
Created point instancer prim |
Source code in omnigibson/utils/physx_utils.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|