'\" t
.\"     Title: SIMULATE
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 08/28/2023
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "SIMULATE" "nged" "08/28/2023" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
simulate \- a Bullet\-based physics simulator for MGED
.SH "SYNOPSIS"
.HP \w'\fBsimulate\fR\ 'u
\fBsimulate\fR [\fIoptions\fR...] \fIpath\fR \fIduration\fR
.SH "DESCRIPTION"
.PP

\fBsimulate\fR
performs rigid\-body physics evaluation\&. The Bullet physics engine is used with a collision algorithm that utilizes the librt ray tracer\&.
.PP
The
\fIpath\fR
parameter specifies the path to the objects within the simulation\&. All primitives under this path are regarded as separate physical objects by default\&. If a combination has the attribute
simulate::type=region, all primitives below it in the hierarchy are regarded as one physical object\&.
.PP
The
\fIduration\fR
parameter specifies the duration of the physics simulation (each use of the
\fBsimulate\fR
command operates within a new physics environment)\&.
.PP
All values are specified in units of meters, kilograms, and seconds\&. Note that Bullet is primarily designed for objects of sizes between approximately 0\&.05 and 10\&.0 meters, with a collision tolerance of 0\&.004 meters; hence, using
\fBsimulate\fR
on a model that is significantly different from this scale may give worse results\&.
.SH "OPTIONS"
.PP
\fB\-\-debug=\fR\fB\fIMODE\fR\fR
.RS 4
Set the debugging mode\&. Multiple mode flags can be separated using commas\&.
.PP
\fIaabb\fR
.RS 4
Draw Bullet\*(Aqs axis\-aligned bounding boxes after the simulation step\&. These can usually be regarded as indicating the "true" position of geometry\&. Any discrepancies may indicate that the
\fBsimulate\fR
command is incorrectly applying the Bullet transformations\&.
.RE
.PP
\fIcontact\fR
.RS 4
Draw all of Bullet\*(Aqs collision contact points during the simulation\&.
.RE
.PP
\fIray\fR
.RS 4
Draw all of the rays fired by the internal collision detection algorithm\&.
.RE
.sp
.RE
.SH "OBJECT ATTRIBUTES"
.PP
The simulation can be configured by setting certain attributes on objects within the specified path\&.
.PP
\fBsimulate::type=\fR\fB\fITYPE\fR\fR
.RS 4
Specify the type of the associated object\&.
.PP
\fIregion\fR
.RS 4
Regard all solids under this combination as belonging to one rigid body\&.
.RE
.sp
.RE
.PP
\fBsimulate::mass=\fR\fB\fISCALAR\fR\fR
.RS 4
Specify the mass of the associated object\&. Objects with a mass of
0\&.0
are immobile\&.
.RE
.PP
\fBsimulate::linear_velocity=<\fR\fB\fIx\fR\fR\fB, \fR\fB\fIy\fR\fR\fB, \fR\fB\fIz\fR\fR\fB>\fR
.RS 4
Specify the linear velocity of the associated object as a vector\&.
.RE
.PP
\fBsimulate::angular_velocity=<\fR\fB\fIx\fR\fR\fB, \fR\fB\fIy\fR\fR\fB, \fR\fB\fIz\fR\fR\fB>\fR
.RS 4
Specify the angular velocity of the associated object as a vector\&.
.RE
.PP
\fBsimulate::gravity=<\fR\fB\fIx\fR\fR\fB, \fR\fB\fIy\fR\fR\fB, \fR\fB\fIz\fR\fR\fB>\fR
.RS 4
Specify the acceleration due to gravity as a vector\&. This attribute can only be applied to the topmost object under
\fIpath\fR\&. The default gravity vector is
<0\&.0, 0\&.0, \-9\&.80665>, specifying an accleration of \-9\&.8 mm/s/s along the z\-axis\&.
.RE
.PP
\fBsimulate::grid_radius=x\fR
.RS 4
Specify the number of rays along the radii of the circular grids of rays fired during collision detection\&. This attribute can only be applied to the topmost object under
\fIpath\fR\&. The default value is
10\&.
.RE
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "COPYRIGHT"
.PP
This software is Copyright (c) 2017\-2023 United States Government as represented by the U\&.S\&. Army Research Laboratory\&.
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
