4.4. Creating objects

There are two kinds of objects in anableps. Those provided by the framework and those that the user can create.

Complex objects are groups of other objects with some constraints that keep then connected in an special way forming the complex object. Complex objects expose only some toponymics

Complex objects can too, have functions on them

Let’s do an example:

body articulate::


end

4.4.1. Building an object

The first section in an object definition is the [build] label. Below this label there is code to build the object

Relative parts are placed using place commands.

4.4.2. Configurations

As we’ve seen in previous chapters, any object is in a given configuration at every moment. You can change configurations with:

object.setConfiguration <configuration>

When defining an object, its possible configurations must be defined as well. Configurations are made of different constraints in the internal place procedure. To generate a configuration, use the

[configuration] tag:

body articulate::

[build]

[configuration basic]
    place b: b.bottom a.top

[configuration static2]
    place b: b.top a.bottom

end articulate

For this reason, is better to place all the common placement in the [build] section and let all the optional placement for the correspoding configuration sections.

4.4.3. Other features

4.4.3.1. Aliases

Objects can have more than one name specially, more than one qualified name [note]. To add more names use the alias keyword:

object myObject::
    alias: things.animals.dog.101

end myObject

4.4.4. Defining special placers

In previous chapters we have seen that some special objects can be placed using snaps. For user-defined ones, there is also that possibility

4.4.5. Inheritance

Sometimes it is useful to inherit from some objects that provide.

The most important ones are:

  • creature:
  • thing:

(No idea how)

4.4.6. Defining external toponymics

This goes like:

object a::

[build]

    # definitions

[toponymics]

    .top = b.top
    .bottom = b.bottom
    .

[actions]

    #some actions defined

end a

4.4.7. Defining functions on them

4.4.8. Configurations (or Stances), actions and behaviours

You can define

There are chapters devoted to these subjects. See xxxxxxxxxxxxx