modelsUnderRay (modelList)

Help please.

I want to add a fifth (modelList) parameter to modelsUnderRay to

Specify model references.

How can I add the fifth parameter?

Currently, I have four parameters:

MYLIST = sprite (1).member.modelsUnderRay (rayLoc,

rayMove, 1, #detailed)

The first parameter ("rayLoc') is the place of departure

point of the ray.

The second parameter ("rayMove") is the direction of the ray.

The third parameter ('1') is the number of models to return.

The fourth parameter (#detailed) is the amount of information to be returned

for each model.

You can replace #detailed with your own specified parameters.

Here is an example I did:

p3Dmember = sprite (me.spriteNum) .member

pCamera = p3Dmember.camera (1)

tModelList = [p3Dmember.model ("wall"), p3Dmember.model ("door")]

tOptionsList = [#maxNumberOfModels: 2, #levelOfDetail: #detailed, #modelList: tModelList, #maxDistance: 200]

-ray casting forward

collisionList = p3Dmember.modelsUnderRay (pCamera.worldPosition, pCamera.transform.zAxis, tOptionsList)

Tags: Director

Similar Questions

  • modelsUnderRay (collisionlist)

    Hello

    I use modelsUnderRay to collect data on collisions on a number of models.

    Is it possible to get the #distance of any named model (which is not necessarily the closest model) of the list of collision?

    A list of all the models and their distances can be a start. Is this possible?

    Like a sort of jargon list, maybe something similar to:

    put Getöne (collisionList, "myModelname")

    or

    put getPos (collisionList, "myModelname")

    -Here's the pseudo-code

    PS I use Director 9.0 (MX) so don't have the range of the current Lingo.

    Take a look at my demo to:

    Director Shockwave Collision 3D

    I have the following code:

    tModelList = [p3Dmember.model ("3Dmember"), p3Dmember.model ("door")]

    tOptionsList = [#maxNumberOfModels: 1, #levelOfDetail: #detailed, #modelList: tModelList, #maxDistance: 200]

    -ray casting forward

    collisionList = p3Dmember.modelsUnderRay (pCamera.worldPosition, pCamera.transform.zAxis, tOptionsList)

    Check the collsionList at some point, I get:

    [[#model: model ("3Dmember"), #distance: 10180.1826, #isectPosition: vector (-3.47622e3, 4.0442, 1.54665e3), #isectNormal: vector (-1.0000, 0.0000 0.0000), #meshID: 39, #faceID: 1, #vertices: [vector (- 3.47622e3, 1.96383e3, - 0.0081), vector (- 3.47622e3, - 1.10613e3, - 0.0081), vector (- 3.47622e3, - 1.10613e3, 3.00697e3)], #uvCoord: [#u: 0.1240, #v: 0.5144]]]

    That only has a pattern in the list put you could have more. It could be a list of liner with each element of a list of properties. You will need to check each item at a time. that is to find the distance of the first question would be:

    dist1 = collisionList [1] .distance

    the second distance model would be:

    dis2 = .distance collisionList [1]

  • Satellite T130-11U and Windows 10

    Hello

    The model of Satellite T130-11U (PST3AE-01200RFR) is eligible for the upgrade to Windows 10?

    If so, is there any configuration software (updated drivers, software uninstaller) to apply first before the upgrade?

    Thank you
    Ilyes

    Check, please follow the list - http://win10upgrade.toshiba.com/swupdate/modellist.aspx?region=TEG
    This list isToshiba of the taken laptop models supported for upgrading to Windows 10

  • The volume control does not work in the ASUS laptop with the keyboard

    Original title: my speaker works well but y I can't control the volume when I press Fn + F10 F11 or F12

    I juz bought the computer for 1 week... it's asus brand... now I nest click to control the volume, because my keyboard cannot control there is no problem for the keyboard...

    There are several versions of the laptop A53S. Go here:

    http://support.ASUS.com/download/ModelList.aspx?SLanguage=en&keyword=A53S&type=1

    Select your exact model, then downlpoad and install the drivers for the sound card. You must also download and install all drivers that you find relevant to your version of W7.

    You should get your features back.

    See you soon,.

    Jerry

  • EclipseLink, JPA, generic entity + SINGLE_TABLE legacy

    I was wondering if it is possible in JPA to define a generic entity as in my case PropertyBase < T > and derive concrete entity like ShortProperty and string classes and use with legacy SINGLE_TABLE mode? If I try to instances of ElementModel commit newly created (see ElementModelTest) on the EntityManager I always get a NumberFormatException this 'value' cannot be successfully converted to a short. Curiously, if I define all the classes below as my test case class 'ElementModelTest' static inner classes, it seems to work. Any ideas that I need to change to make it work?

    I use EclipseLink eclipselink - 2.6.0.v20131019 - ef98e5d.

    public abstract class PersistableObject
        implements Serializable {
    
        private static final long serialVersionUID = 1L;
    
        private String id = UUID.randomUUID().toString();
    
        private Long version;
    
        public PersistableObject() {
               this(serialVersionUID);
        }
    
        public PersistableObject(final Long paramVersion) {
              version = paramVersion;
        }
    
        public String getId() {
     return id;
        }
    
        public void setId(final String paramId) {
      id = paramId;
        }
    
        public Long getVersion() {
     return version;
        }
        public void setVersion(final Long paramVersion) {
      version = paramVersion;
        }
    
        public String toString() {
      return this.getClass().getName() + "[id=" + id + "]";
        }
    
    }
    

    public abstract class PropertyBase<T> extends PersistableObject {
    
        private static final long serialVersionUID = 1L;
    
        private String name;
        private T value;
    
        public PropertyBase() {
     this(serialVersionUID);
        }
    
        public PropertyBase(final Long paramVersion) {
      this(paramVersion, null);
        }
    
        public PropertyBase(final Long paramVersion, final String paramName) {
      this(paramVersion, paramName, null);
        }
    
        public PropertyBase(final Long paramVersion, final String paramName, final T paramValue) {
      super(paramVersion);
      name = paramName;
      value = paramValue;
        }
    
        public String getName() {
     return name;
        }
    
        public void setName(final String paramName) {
      name = paramName;
        }
    
        public T getValue() {
     return value;
        }
    
        public void setValue(final T paramValue) {
      value = paramValue;
        }
    
    }
    

    public class ShortProperty extends PropertyBase<Short> {
    
        private static final long serialVersionUID = 1L;
    
        public ShortProperty() {
     this(null, null);
        }
    
        public ShortProperty(final String paramName) {
      this(paramName, null);
        }
    
        public ShortProperty(final String paramName, final Short paramValue) {
      super(serialVersionUID, paramName, paramValue);
        }
    
    }
    

    public class StringProperty extends PropertyBase<String> {
    
        private static final long serialVersionUID = 1L;
    
        protected StringProperty() {
     this(null, null);
        }
    
        public StringProperty(final String paramName) {
      this(paramName, null);
        }
    
        public StringProperty(final String paramName, final String paramValue) {
      super(serialVersionUID, paramName, paramValue);
        }
    
    

    }

    public class ElementModel extends PersistableObject {
    
        private static final long serialVersionUID = 1L;
    
        private StringProperty name = new StringProperty("name");
        private ShortProperty number = new ShortProperty("number");
    
        public ElementModel() {
     this(serialVersionUID);
        }
    
        public ElementModel(final Long paramVersion) {
      super(paramVersion);
        }
    
        public String getName() {
      return name.getValue();
        }
    
        public void setName(final String paramName) {
      name.setValue(paramName);
        }
    
        public Short getNumber() {
      return number.getValue();
        }
    
        public void setNumber(final Short paramNumber) {
      number.setValue(paramNumber);
        }
    
    
    }
    

    <?xml version="1.0" encoding="UTF-8" ?>
    <entity-mappings version="2.1"
     xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd">
    
     <mapped-superclass
      class="PersistableObject">
      <attributes>
      <id name="id">
      <column name="id" />
      </id>
      <version name="version" access="PROPERTY">
      <column name="version" />
      </version>
      </attributes>
     </mapped-superclass>
    
     <entity class="PropertyBase">
      <table name="PropertyBase" />
      <inheritance />
      <discriminator-column name="type"/>
      <attributes>
      <basic name="name">
      <column name="name" />
      </basic>
      <basic name="value">
      <column name="value" />
      </basic>
      </attributes>
     </entity>
    
     <entity class="StringProperty">
      <discriminator-value>StringProperty</discriminator-value>
     </entity>
    
     <entity class="ShortProperty">
      <discriminator-value>ShortProperty</discriminator-value>
     </entity>
    
     <entity class="ElementModel">
      <table name="ElementModel" />
      <inheritance />
      <discriminator-column name="type"/>
      <attributes>
      <one-to-one name="name">
      <join-column name="name" referenced-column-name="id" />
      <cascade>
      <cascade-all />
      </cascade>
      </one-to-one>
      <one-to-one name="number">
      <join-column name="number" referenced-column-name="id" />
      <cascade>
      <cascade-all />
      </cascade>
      </one-to-one>
      </attributes>
     </entity>
    </entity-mappings>
    


    public class ElementModelTest extends ModelTest<ElementModel> {
    
        public ElementModelTest() {
      super(ElementModel.class);
        }
    
        @Test
        @SuppressWarnings("unchecked")
        public void testSQLPersistence() {
    
      final String PERSISTENCE_UNIT_NAME = getClass().getPackage().getName();
      new File("res/db/test/" + PERSISTENCE_UNIT_NAME + ".sqlite").delete();
    
      EntityManagerFactory factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
      EntityManager em = factory.createEntityManager();
    
      Query q = em.createQuery("select m from ElementModel m");
      List<ElementModel> modelList = q.getResultList();
      int originalSize = modelList.size();
    
      for (ElementModel model : modelList) {
          System.out.println("name: " + model.getName());
      }
    
      System.out.println("size before insert: " + modelList.size());
    
      em.getTransaction().begin();
    
      for (int i = 0; i < 10; ++i) {
          ElementModel device = new ElementModel();
          device.setName("ElementModel: " + i);
        device.setNumber((short) i);
          em.persist(device);
      }
    
      em.getTransaction().commit();
    
      modelList = q.getResultList();
      System.out.println("size after insert: " + modelList.size());
    
      assertTrue(modelList.size() == (originalSize + 10));
    
      em.close();
    
        }
    
    }
    


    He replied by a cross post here java - EclipseLink, JPA, generic entity + SINGLE_TABLE legacy - Stack Overflow

    Short answer: no, it should not run because the underlying database field type would be constant.  If the chain or the short would have conversion problems in the type of database, they both put in correspondence in the same field in table.

  • Error in a script and I can´t find it

    Hello
    I found a very interesting tutorial on a Fly-low Archtitcural on the Adobe site.
    As I tried to do the same thing, I had a mistake in the Lingo Script which was providet with the tutorial. I have no experience with Lingo so I can´t find the error. Could sombody find the error?
    I have marked the line with < < < < < < < <
    Here's the Script (just a bit long)
    You can see the full tutorial here: http://www.adobe.com/devnet/director/articles/shockwave_3d/shockwave3d_ch3.pdf

    on beginSprite (me)

    -initialization of properties

    pMember = sprite (me.spriteNum) .member
    pSprite = sprite (me.spriteNum)
    pMouseDown = FALSE
    pRightMouseDown = FALSE
    pCamera = .camera sprite (me.spriteNum)
    pCamAnimFlag = TRUE
    pCamAnimInfo = [#initT: pCamera.transform.duplicate (),]
    #finalT: pMember.camera ("first_person").transform.duplicate (),.
    [#count: 0]

    -create the camera bounding sphere

    Mr = pMember.newModelResource ("camera_sphere", #sphere)
    Mr.RADIUS = 7.5
    pCameraSphere = pMember.newModel ("camera_sphere", mr)

    -create a light to carry with the camera

    camLight = pMember.newLight ("camera_light", #point)
    camLight.color = rgb (170,170,170)

    -make the sphere and the children of the camera light

    pCamera.addChild (pCameraSphere, #preserveParent)
    pCamera.addChild (camLight, #preserveParent)

    -you save it the camera for the timeMS event to run the intro animation, as appropriate

    pCamera.registerScript(#timeMS,#animateCamera,me,0,50,51)

    -members you add to ordinary timeMS events in order to respond to user input and adjust the camera "collisions".

    pMember.registerForEvent(#timeMS,#controlCamera,me,2500,50,0)
    end beginSprite

    on mouseDown (me)

    -update of the mouse to the bottom of the property

    pMouseDown = TRUE
    end mouseDown
    on mouseUp (me)

    -update of the mouse to the bottom of the property

    pMouseDown = FALSE
    end mouseUp
    on rightMouseDown (me)

    -updated the right mouse to the bottom of the property

    pRightMouseDown = TRUE
    end rightMouseDown
    on rightMouseUp (me)

    -updated the right mouse to the bottom of the property

    pRightMouseDown = FALSE
    end rightMouseUp
    -The animateCamera handler is used to animate the camera automatically over time:
    on animateCamera (me)

    -incrementing the internal counter of the animation

    pCamAnimInfo.count = pCamAnimInfo.count + 1 < < < < < < I get an Errormessage in this line!

    -determine the percentage of interpolation

    PCTG = 100.0 × (pCamAnimInfo.count / 50.0)

    -If pctg is greater than the end animation sequence 100

    If (pctg > 100) then
    PCTG = 100
    pCamAnimFlag = FALSE
    end if

    -determine the new camera interpolated transformation

    t = pCamAnimInfo.initT.interpolate (pCamAnimInfo.finalT, pctg)

    -apply the transformation to the camera

    pCamera.transform = t
    end animateCamera

    on controlCamera (me)

    -answer only if the camera intro animation ends

    If not (pCamAnimFlag) then

    -CONTROL THE CAMERA LEFT/RIGHT ROTATION
    -If the SHIFT key is * not * to the bottom then follow the mouse
    -to adjust the left right to research

    otherwise (the shiftDown) then

    -Did the locH mouse wrt the loc of sprite

    deltaH = the mouseH - pSprite.locH

    -calculate the value of rotation to apply

    ROTN =-(deltaH/165.0) * 4.0

    -apply rotation

    pCamera.rotate (vector (0,0,1), rotn, pCamera.worldPosition, #world)
    end if

    -THE REAR OF THE CONTROL DEVICE MOVEMENT
    -If the left mouse is down then reach the character forward

    If pMouseDown then
    pCamera.translate(0,0,-2.5)
    end if

    -If the right mouse is down then reach the character backward

    If pRightMouseDown then
    pCamera.translate (0,0,2.5)
    end if

    -Casting a fwd/bckwrd ray, depending on which mouse button is pressed

    case (TRUE)

    -left mouse down, ray casting forward

    (pMouseDown):

    -ray casting

    tList = pMember.modelsUnderRay (pCamera.worldPosition, - pCamera.transform. zAxis, #detailed)

    -If there are models in front of the camera, checking for collisions

    If (tList.count) then
    me.checkForCollision(tList[1])
    end if

    -mouse right (Ctrl +) down, ray casting back

    (pRightMouseDown):

    -ray casting

    tList = pMember.modelsUnderRay (pCamera.worldPosition, pCamera.transform. #detailed, zAxis)

    -If there are models in front of the camera, checking for collisions

    If (tList.count) then
    me.checkForCollision(tList[1])
    end if
    cases of termination

    -a little to the left

    tList = pMember.modelsUnderRay (pCamera.worldPosition, - pCamera.transform. xAxis, #detailed)

    -If there are models in front of the camera, checking for collisions

    If (tList.count) then
    me.checkForCollision(tList[1])
    end if

    -a little to the right

    tList = pMember.modelsUnderRay (pCamera.worldPosition, pCamera.transform.xAxis, #detailed)

    -If there are models in front of the camera, checking for collisions

    If (tList.count) then
    me.checkForCollision(tList[1])
    end if
    end if
    end controlCamera
    on checkForCollision (, thisData)

    -Enter the value to the distance

    Dist = thisData.distance

    -If the distance is less than the limit of RADIUS, resolve collisions

    If (dist < pCameraSphere.resource.radius) then

    -get the penetration distance

    diff = pCameraSphere.resource.radius - dist

    -calculate the vector perpendicular to the surface of the wall to move the camera

    tVector = thisData.isectNormal * diff

    -move the camera in order to resolve the collision

    pCamera.translate (tVector, #world)
    end if
    end checkForCollision

    Yes, you are in the right. She's.
    I forgot to copy the Script! I have copied the statement haven´t.
    Thank you very much for your quick help,

    Good bye

  • Models under the Collision Ray

    Basically, I have a simple 3D, with uneven terrain scene and a character (3DSMax teapot!) I want to follow the terrain. I implemented the script movement separately and created a collisionDetection script using modelsUnderRay. problem is that my character floats away. It turns off position in some strange angle almost vertically in time with the registerForEvent deadline... Someone at - he seen this before or have any ideas? Here is the script code, anyway...

    Like this?

    http://robotduck.com/content/articles/Director/collision/modelsUnderRay/wallCollision_V-RA y - FPS.htm

    Enjoy!

    -Ben

Maybe you are looking for

  • Bankworm?

    I was surfing just using safari on my mac, el capitan, when a box pops up saying this was apple.com saying that a virus has been detected and I must scan. I watched for a while and foolishly you click ok. He came to say that bank Trojan worm was dete

  • Installation of Windows ME on Satellite Pro L20

    I need for the program to install windows Millennium Edition on my new laptop, but when he starts (during the installation procedure) search for devices it crushes and just stop.What can I do? I tried to update the BIOS but still the same after.

  • Satellite P20 doesn't work anymore - clear CMOS?

    Hi all My laptop Satellite P20 no longer works, the system switches, but nothing happens, nothing on the screen, just the fans blowing air. I would like to clear CMOS, but I don't know which bridge to shorten on the motherboard. I also saw this: [htt

  • RT FIFO, several variables

    Hello I use 2 loops on a CompactRIO 9074. One is for the deterministic i/o, synchronized with the scanning engine and the other for the e/s network with a client PC. I'm waiting for data in the network using shared variables published network loop, a

  • Problems with multiple worksheets XY plotting (program generates repeated data)

    Hello I want to make a small program that will reduce the amount of time to go forward with the measurement data. I get data into .dat format, where all the files consist of frequency measurement with an X and a Y column. The problem is that I made 4