AgeCollision

From Alcugs

Jump to: navigation, search

Note: Anything extracted from any Plasma Resource Files is property of Cyan Worlds, Inc. You may not use these assets without recieving written permission from Cyan Worlds, Inc.

Please read this Notice from Cyan about Age Creation before continuing.

Previous: Adding Additional Pages Contents Next: Kickables Objects

Contents

Adding Collision to an Object

You've created an Age, you've textured an Age, you've linked to your Age: but you fell through the floor! In order to fix this, you must add proper collision to your Age. Open your Age in Blender and select an object that should be solid.

On the Buttons Panel, click the small button with the purple smilie. Click the Add Property button, and create a new string property called col_type with a value of 4.
Image:Collision.jpg

This will add the easiest type of collision to the object. Repeat this process for all of the objects that require collision.

At this time I'm not sure what the value of 4 means. I haven't tried using other values, but I would imagine that they produce different effects.

Video tutorial

I have made a easy 5 steps video tutorial

Advanced Collision

Dynamic versus Static

A static object, is one which its center will be always at the center of the age, and that cannot be, animated, moved, etc. Although you can do it with python, collision updates received from the server are always ignored for this type of object. These objects do not have a coordinate interface, and if they have one, Uru ignores it very nicely (it applyes the transformation to the draw interface, but the physical stays untransformed). In order to enable/disable draw and collision of this type of objects, it is necessary to attach the object to the script "xAgeSDLBoolShowHide.py" or any other similar, adding also the corresponding SDL variable. ( Attaching objects to python scripts)

A dynamic object will have always a coordinate interface, and depending of it's flags, it will or not send updates to other clients. Also, dynamic object depending of the flags, will interact with the avatars and the world.

Uru determines that any object which a mass set to zero it's static. Objects with a non-zero mass will be always dynamic.

Colliders without a draw interface

By default we are generating collision information for our drawable objects, by setting these properties over them. But if we don't want a draw interface. The effect is an invisible collider, we need to add the "alctype" string property set to the value "collider". Also sometimes you may want to reduce the amount of vertices of the object's collider to reduce the time required by the engine to compute the collision updates. Less vertices are faster, more vertices cause more lag. If you look at Cyan ages, you will see that a set of different objects, will have only one corresponding collider with a reduced amount of vertices.

Properties

Note, some properties may be removed in the future, and mapped into real blender properties. So, it will be a good idea to set both at the same time.

There is no documentation about this properties, so in order to improve the plugin there are two tasks.

A) Look at the flags set by the Cyan ages, and try to guess what each flag does.

B) Create a set of different objects with different flags, and see what happens.

And then come here and write your finding.

col_type

String property.

Collision types.

1 - Bounding Box: The engine will use the faces of the object's bounding box for collision detection.
2 - Bounding Sphere: The engine will use the object's bounding sphere for collision detection.
3 - Convex Hull: The engine will use the faces of the object's convex hull for collision detection.
4 - ConcaveMesh?/Triangles: The engine will use the faces of the object for collision detection.
5 - PolygonSoup?/Terrain: The engine will use the faces of the object for collision detection.

I'm not sure very well the difference between 4 and 5. If someone notices some different effect, please edit this and explain it.

mass

Float property.

Sets the mass of the object. By default it's 0.

rc

Float property.

Sets the friction coefficient.

Dustin: Here are some that I have tried.
0.4 -> slide about 6-8 feet.
1.5 -> slide about 3 feet.
4.0 -> slide about 1 foot. This is the one that I recommend.
10.0 -> slide about nothing! A little disconcerting.
/Dustin

el

Float property.

Sets the elasticity coefficient.

Dustin: Here are some that I have tried with a cube of mass=5
2.0 ->I kicked the cube forward about 4 feet.
10.0 -> The cube hurled through the air and over the edge!
/Dustin

col_flags0

String Property. It's a 16 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x0002 - ?????? Camera colliders, cone collision????
0x0100 - Enables collision with avatars - object state is saved into the age sav
0x0200 - Enables collision with avatars - object state is not saved. (default)
0x0400 - ?????? GameObjects - sensors, buttons???

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

col_flags1

String Property. It's a 32 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x00000000 - ??????

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

col_flags2

String Property. It's a 32 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x00000000 - ??????
0x02000000 - Enables collision with static objects, and other objects (default)
0x01000000 - Enables collision with kickables only (you must set col_flags0 to 0x0000 also)

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

col_flags3

String Property. It's a 16 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x0000 - ??????

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

col_flags4

String Property. It's a 32 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x00000001 - kDisable
0x00000002 - kWeightless
0x00000004 - kPinned
0x00000008 - kWarp
0x00000010 - kUpright
0x00000020 - kPassive
0x00000040 - kRotationForces
0x00000080 - kCameraAvoidObject
0x00000100 - kPhysAnim
0x00000200 - kStartInactive
0x00000400 - kNoSyncronize
0x00000800 - kSuppressed

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

col_flags5

String Property. It's a 32 bits field, that must be typed in hexadecimal.

Known flags. (please help documenting this, by testing new flags, and explaining what happens, note that Uru can crash if it doesn't support some flags)

0x00000000 - ??????
0x00000002 - Might have something to do with clickables???
0x00000004 - Makes object walls solid to the camera. Camera doesn't pass through walls
0x00000040 - disables friction (between avatars and the collider)

Note: You must set the result of the or operation of all flags. For example: 0x0602, is the result of flags 0x0002 or 0x0400, 0x0200.

Previous: Adding Additional Pages Contents Next: Kickables Objects
Personal tools