11.1. Things library

One of the principles of Anableps, in order to be powerful, is to mix highest-level abstractions, with the possibility to come down to the real drawing. That’s why it needs vaste libraries

  • buildings:
    • Houses: any kind of house
    • Monuments: eiffel, giza, rascacielos famosos
    • house: tipos de casas
  • vehicles:
    • car:
    • plane
    • ship
  • Beings:
    • insects
    • animals:
    • persons:
    • aliens:
    • ghosts:
  • Things:
    • tools
    • books
    • forniture

Existing so many examples, things follow an strict hierarhy. If you implement one, you must conform to the path. For example, for a bee:

beings.insects.bee.2

This select the ssecond bee that is stored. normally

ejemplos:

h = thing.horse.23 : .size 124% .weight 40%
put h onto floor.point(20,30)     ## put, connect, snap, call for special handlers for placing.
l = lego.brick.2.2 .color red
l.snap moonScape.pos(34,23);   ## they return two complimentary handlers, the match works and the piece is placed.

11.1.1. Attributes:

General attributes for all the bodies:

  • .material: a material, with density, etc

  • .color: a default color. This can be overriden, as there are bodies with more than one color

  • .tags: an array of tags that can be used later to group or select

  • .volume [RW]: returns the volume of this. Setting the volume scales the body

  • .mass [RW]: returns the mass of the body

  • .weight [R]: returns the weight of the body. If a name is given, it will be takes as a place where to return the weight:

    >> c = Sphere: .radius 40km .material titanium
    >> c.weight .at saturn?
    >> 45kgs
    
  • .print Saves this object to a graphical file. Directly saving a 3d object is a short cut to putting it in the scene, selecting and placing a camera and choosing a renderer to the filename. This method is used to easily get images of an object: it allows some tuning as the parameters below shoe, but for the full control you probably want to place the object in a scene, define a camera and render it.

11.1.1.1. things

Things are the basic thing. They can posses configurations for different parameter settings of the think.

Configurations can be manually changed by typing:

myObject.configure

11.1.1.2. Beings

Beings are special in the sense that, in addition to the configurations (or stances as they are called here), hey can be alive and execute actions and behave according to behaviours

11.1.2. Stances

standing:
sitting:
laying:

11.1.3. Actions

lay:
sit:
walk:
run:
sleep:sleeps
jump:
dance:
hide&seek:
attack:attacks a person

11.1.4. Behaviours

Behaviours are packs of actions, executed in a given order and with a given interactions with us (CMAM)

All beings have the following behaviours defined:

wait:waits for some time or some condition
enjoy:the character goes around enjoying being alive
flee:the character flees away from some points

11.1.4.1. Vehicles

Vehicles move

11.1.4.2. Buildings

Building are things, nothing new here