Ignore:
Timestamp:
06/20/20 01:09:57 (5 years ago)
Author:
Maciej Komosinski
Message:

Added new receptors (Gp:"gyroscope" on a Part, Tp:Touch-proximity and Tc:Touch-contact) and improved existing ones (T, G)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/neuro/neuroimpl.cpp

    r932 r952  
    1313#include <frams/simul/simul.h>
    1414#endif
     15#include <frams/vm/classes/3dobject.h>
    1516
    1617const int NeuroImpl::ENDDRAWING = -9999;
     
    153154}
    154155
     156void NeuroNetImpl::getLiveNeuroObject(Neuro *n, ExtValue *ret)
     157{
     158        NeuroImpl *ni = getImpl(n);
     159        if (ni)
     160                ret->setObject(ExtObject(&NeuroImpl::getStaticParam(), ni));
     161        else
     162                ret->setEmpty();
     163}
     164
    155165///////////////////////////////////////////////
    156166
     
    301311ParamEntry neuroimpl_tab[] =
    302312{
    303         { "Neuro", 1, 27 + NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." },
     313        { "Neuro", 1, 29 + NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." },
    304314
    305315        { "getInputState", 0, 0, "Get input signal", "p f(d input)", PROCEDURE(p_get), },
     
    324334        { "position_y", 0, PARAM_READONLY, "Position y", "f", GETONLY(position_y), },
    325335        { "position_z", 0, PARAM_READONLY, "Position z", "f", GETONLY(position_z), },
     336        { "relative_pos", 0, PARAM_READONLY, "Relative position", "oXYZ", GETONLY(relative_pos), },
     337        { "relative_orient", 0, PARAM_READONLY, "Relative orientation", "oOrient", GETONLY(relative_orient), },
    326338        { "creature", 0, PARAM_READONLY, "Gets owner creature", "oCreature", GETONLY(creature), },
    327         { "part", 0, PARAM_READONLY, "The Part object where this neuron is located", "oMechPart", GETONLY(part), },
    328         { "joint", 0, PARAM_READONLY, "The Joint object where this neuron is located", "oMechJoint", GETONLY(joint), },
     339        { "mechpart", 0, PARAM_READONLY, "MechPart object", "oMechPart", GETONLY(part), "The MechPart object where this neuron is located" },
     340        { "mechjoint", 0, PARAM_READONLY, "MechJoint object" , "oMechJoint", GETONLY(joint), "The MechJoint object where this neuron is located" },
    329341        { "neuroproperties", 0, PARAM_READONLY, "Custom neuron fields", "oNeuroProperties", GETONLY(fields),
    330342        "Neurons can have different fields depending on their class. Script neurons have their fields defined using the \"property:\" syntax. If you develop a custom neuron script you should use the NeuroProperties object for accessing your own neuron fields. The Neuro.neuroproperties property is meant for accessing the neuron fields from the outside script.\n"
     
    549561}
    550562
     563void NeuroImpl::get_relative_pos(ExtValue *ret)
     564{
     565        ret->setObject(Pt3D_Ext::makeDynamicObject(getRelativePosition()));
     566}
     567
     568void NeuroImpl::get_relative_orient(ExtValue *ret)
     569{
     570        ret->setObject(Orient_Ext::makeDynamicObject(new Orient_Ext(getRelativeOrientation())));
     571}
    551572
    552573void NeuroImpl::createFieldsObject()
Note: See TracChangeset for help on using the changeset viewer.