Warhorse ScripBind documentation
ContentsIndexHome
PreviousUpNext
CScriptBind_Entity::Physicalize Method
Syntax
C++
int Physicalize(IFunctionHandler* pH, int nSlot, int nPhysicsType, SmartScriptTable physicsParams);
Parameters 
Description 
nSlot - Slot identifier, if -1 use geometries from all slots.</param 
!  
nPhysicsType - Type of physical entity to create.</param 
!  
physicsParams - Table with physicalization parameters.</param 
 

!

Entity.Physicalize( int nSlot,int nPhysicsType,table physicsParams )

! ! Create physical entity from the specified entity slot. ! ! Physics Type Meaning ! ------------- ----------- ! PE_NONE No physics. ! PE_STATIC Static physical entity. ! PE_LIVING Live physical entity (Players,Monsters). ! PE_RIGID Rigid body physical entity. ! PE_WHEELEDVEHICLE Physical vechicle with wheels. ! PE_PARTICLE Particle physical entity, it only have mass and radius. ! PE_ARTICULATED Ragdolls or other articulated physical enttiies. ! PE_ROPE Physical representation of the rope. ! PE_SOFT Soft body physics, cloth simulation. ! PE_AREA Physical Area (Sphere,Box,Geometry or Shape). !  

! ! ! Params table keys Meaning ! ----------------- ----------- ! mass Object mass, only used if density is not specified or -1. ! density Object density, only used if mass is not specified or -1. ! flags Physical entity flags. ! partid Index of the articulated body part, that this new physical entity will be attached to. ! stiffness_scale Scale of character joints stiffness (Multiplied with stiffness values specified from exported model) ! Particle This table must be set when Physics Type is PE_PARTICLE. ! Living This table must be set when Physics Type is PE_LIVING. ! Area This table must be set when Physics Type is PE_AREA. !  

! ! ! Particle table Meaning ! ----------------- ----------- ! mass Particle mass. ! radius Particle pseudo radius. ! thickness Thickness when lying on a surface (if 0, radius will be used). ! velocity Velocity direction and magnitude vector. ! air_resistance Air resistance coefficient, F = kv. ! water_resistance Water resistance coefficient, F = kv. ! gravity Gravity force vector to the air. ! water_gravity Gravity force vector when in the water. ! min_bounce_vel Minimal velocity at which particle bounces of the surface. ! accel_thrust Acceleration along direction of movement. ! accel_lift Acceleration that lifts particle with the current speed. ! constant_orientation (0,1) Keep constance orientation. ! single_contact (0,1) Calculate only one first contact. ! no_roll (0,1) Do not roll particle on terrain. ! no_spin (0,1) Do not spin particle in air. ! no_path_alignment (0,1) Do not align particle orientation to the movement path. !  

! ! Living table Meaning ! ----------------- ----------- ! height Vertical offset of collision geometry center. ! size Collision cylinder dimensions vector (x,y,z). ! height_eye Vertical offset of the camera. ! height_pivot Offset from central ground position that is considered entity center. ! head_radius Radius of the head. ! height_head Vertical offset of the head. ! inertia Inertia coefficient, the more it is, the less inertia is; 0 means no inertia ! air_resistance Air control coefficient 0..1, 1 - special value (total control of movement) ! gravity Vertical gravity magnitude. ! mass Mass of the player (in kg). ! min_slide_angle If surface slope is more than this angle, player starts sliding (In radians) ! max_climb_angle Player cannot climb surface which slope is steeper than this angle (In radians) ! max_jump_angle Player is not allowed to jump towards ground if this angle is exceeded (In radians) ! min_fall_angle Player starts falling when slope is steeper than this (In radians) ! max_vel_ground Player cannot stand on surfaces that are moving faster than this (In radians) !  

! ! ! Area table keys Meaning ! ----------------- ----------- ! type Type of the area, valid values are: AREA_SPHERE,AREA_BOX,AREA_GEOMETRY,AREA_SHAPE ! radius Radius of the area sphere, must be specified if type is AREA_SPHERE. ! box_min Min vector of bounding box, must be specified if type is AREA_BOX. ! box_max Max vector of bounding box, must be specified if type is AREA_BOX.. ! points Table, indexed collection of vectors in local entity space defining 2D shape of the area, (AREA_SHAPE) ! height Height of the 2D area (AREA_SHAPE), relative to the minimal Z in the points table. ! uniform Same direction in every point or always point to the center. ! falloff ellipsoidal falloff dimensions; 0,0,0 if no falloff. ! gravity Gravity vector inside the physical area. !  

!!

Copyright (c) 2012. All rights reserved.