ActionScript 3.0 :: Finding Collision Point And Normal Vector?

Aug 30, 2009

I got a working broad phase and collision detection is fast enough.Now my collision response is working, but slow. I have trace(using getTimer()) through the whole resolving method, and I found the slow spot is where I get the collision point and normal vector.

Right now, I test each point on each shape against each line on the other shape. This works nice on triangles, but other shapes, it much to slow.I would think that using SAT(seperating axis therom) would have a way to get this when checking collisions, but I cant seem to get it.I need a fast way to get the collision point and normal vector.(Right now, it takes about 3 milliseconds per collison on a rectangle with 4 points and 4 lines)

View 0 Replies


Similar Posts:


ActionScript 3.0 :: Finding A Point Relative To A Center Point?

Nov 9, 2010

I'm trying to figure out how to find a point relative to the center of an object, modified by its rotation. For example, in the attached swf, I've been messing around trying to draw trails to a bitmap, coming out of the thrusters. I didn't have a problem at first, but as the ship rotated, the lines that were being drawn wouldn't remain relative.

http:[url]....

I'm sure this is because I have no idea what I'm doing, and I've just been sort of idioting my way through it. That aside, is there an easy way to find the point I'm looking for? For instance, say I want a point at Y -14 of my ship, but I want that to remain relative to the ship as it rotates.

View 14 Replies

ActionScript 3.0 :: Finding The Default Color Of A Vector?

Jan 27, 2010

I have a situation where you have an object, lets say a dog. The artwork of the dog is black in color. In this case i know that the default color of the dog vector is 0x000000. However, lets say i have 30 different dogs of varying color. You can change the color of the dog at runtime, but when you reset, id like to return to the default color. Does anyone know how to do this or can hit me with a search term? Note that what i am after is finding the initial default color value and not the implementation as i can work it out for myself.

View 1 Replies

ActionScript 3.0 :: Finding Vector Of Question Mark

Oct 8, 2010

The image describes my issue, I am trying to find the vector of the question mark, which should describe the objects new vector for velocity.
vector (7,2) is my objects current velocity.
If I know the new angle, how can I get the new vector?

View 5 Replies

ActionScript 3.0 :: HitTest() Point Of Collision?

Dec 4, 2009

I've found the BitmapData.hitTest() function very handy, but limited for my purposes. I need to figure out at exactly which point the two images collide  (in any coords system,really), since their behaviour will change depending on the angle of the surface hit

View 9 Replies

ActionScript 2.0 :: Detect Collision Between A Point?

Jun 25, 2008

Because I want to detect collision between a point and an MC contained within another MC.

View 1 Replies

ActionScript 3.0 :: 3d And Finding Any Point In A Child In 3d Space

Dec 31, 2010

i was wondering if there was something that allowed you to grab any 2d point that exists inside a movieclip and grab the 3d position of that exact point...

for example i have a rectangle movieclip on the stage .. and its rotate on the x axis 75 degrees.. registration of the clip is at bottom middle.. so when it rotates the bottom stays in the same spot and everything rotates around it..

now what if i wanted to know the exact x,y,z of the top edge of the clip..

is there a function similar to localToGlobal that would take the x,y coordinate inside the clip and spit back a global 3d point .. (i guess its called a Vector3D)

View 0 Replies

ActionScript 2.0 :: Any Way To Find Vector With One Point / Angle

Apr 13, 2006

I am looking for a way to find a vector if I know one point and 1 angle. Like I have A(x, y) and a vector starting from A(x, y) with an angle. I would like to know the position on a point X (x, y) that can be anywhere on that vector. I only know the coordinates of A and the angle. Possible?? I guess it has to be a function...

View 5 Replies

ActionScript 3.0 :: Rotated Bounding Box Collision With A Point/sphere

Jul 7, 2010

I need to know what side of a rotated box my sphere/point is colliding with and at what angle.

I could perform the 4 lines check but I think it will be too cpu consuming. I need it for fast simple physics simulations(bounces)..

View 9 Replies

ActionScript 3.0 :: Flash Finding Nearest Point Of The Outside Of Two Objects

Aug 8, 2011

[Code]....

two balls are stationary on stage and I am dragging ball 1 between them. I want my program to deny the ability to do this (technical terms) and move the ball automatically to the closest point available that does not overlap either of the other two balls i.e. the left side of the dragged ball may touch but not over lap ball 3. I have a feeling the circular equation: (x-a)^2 + (Y-b)^2 = c comes into it but it may need pythagoras instead as the balls are all circular but not all the same size. The best way I can see for this is to write a multi-part equation for the bounds of boths balls and then finding the nearest point, but not sure how to do this in as3, perhaps using the 'for each' tag.

View 3 Replies

ActionScript 1/2 :: Finding The Minimum Y Point In A Complex Shape In A Given X Coordinate?

Dec 1, 2010

Iīd like to know if itīs possible to find a minimum y point (where the shape ends) of a shape, in a given x coordinate.
 
Example: I have a complex shape like a big "S". Suppose the "S" minimum x coordinate is 0. How can I find the minimum y point of the "S" (again, where the shape ends) in the x coordinate of 14?
 
Here is the image: I need to find the y coordinate (or point) of the blue point in the image. 

View 11 Replies

ActionScript 3.0 :: Finding Stage Coordinates Of Point Inside Rotated MC

Jun 5, 2011

I have a Movieclip (MC1) with and moving object (OBJ1) inside it and using AS3. I want to do a hit test on it with another object (OBJ2) that is on the stage. Normally I would just do MC1.x + OBJ1.x to get my coords for the hit test. But how do I do it if MC1 has been rotated?

View 2 Replies

ActionScript 2.0 :: Vector Scaling Object Without Affecting The Original Point

Mar 30, 2005

Vector Scaling Object Without Affecting the Original Point

View 1 Replies

Flex :: Find Right - Leftmost 2d Point Of A Horizontal Circle In 3d Vector Environment?

May 20, 2010

I'm drawing a 3D pie chart that is calculated with in 3D vectors, projected to 2D vectors and then drawn on a Graphics object. I want to calculate the most left and right point of the circle after projected in 2d. (So not 0 and 1 Pi!) The method to create a vector, draw and project to a 2d vector are below. Anyone knows the answer?

[Code]...

View 1 Replies

ActionScript 3.0 :: Vector Of A Superclass Hold A Reference To A Vector Of A Subclass?

Sep 13, 2011

I'm getting

ActionScript Code:
1067: Implicit coercion of a value of type
__AS3__.vec:Vector.ie.aro.floorplanviewer.model.buildingVOs:ConfigurationVO>[code]....

which surprises me as ConfigurationVO inherits from NodeVO.Is the compiler really not able to figure out that a Vector of a superclass should be able to hold a reference to a Vector of a subclass?

View 7 Replies

Professional :: Import Photoshop Vector And/or Vector Styles?

May 7, 2010

I need to import a bunch of vector work from Photoshop into Flash. Is there a trick to it. So far, on import, it's converting the layer styles into black.

View 5 Replies

ActionScript 3.0 :: Vector Of Objects - Pass In A Vector To A Function?

Jul 23, 2011

If I want to pass in a vector to a function, a vector of any object specifed would it be someVetor:Vetor.<T>? beause FB 4.5 sais T is undefined.

View 10 Replies

Actionscript 3 :: Increase Vector Length To 200 After New Vector.<String>(100)?

Dec 24, 2010

Created Vector with the initial length of 100.

var v:Vector. = new Vector.(100);

v[90] = "Ninety"

v[190] ="oneninety" //RangeError: Error #1125: The index 110 is out of range 100.

//How to change the length from 100 to 200 to store a value at index 190

View 1 Replies

Collision Detection Incorrectly Detecting Collision?

Oct 16, 2009

In my file (AS2), I have a small square at the middle of the page. Diagonally to the right, I have a vertical wall which is a rectangle. Pasted inside my small square, I have the code:

onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (this.hitTest(Wall._x, Wall._y, false))  _x =

[code]......

View 1 Replies

Actionscript 3 :: Vector Number Does Not Extend Vector

Nov 16, 2011

I am currently being confused by the Vector class.I wrote a beautiful XML to TypedClass parser. Works beautifully and without fault. UNTIL a co-worker noticed we got a Conversion Error for Vector.<Number> to Vector.<*>.

Every Vector I've ever tested all extend Vector.<*>.

Vector.<Sprite>, Vector.<String>, Vector.<Point>, Vector.<Boolean>, Vector.<TextField>, Vector.<CustomObject>, etc etc etc. ALL of them.
<type name="__AS3__.vec::Vector.<String>" base="__AS3__.vec::Vector.<*>" isDynamic="true" isFinal="false" isStatic="false">
<extendsClass type="__AS3__.vec::Vector.<*>"/>

[code]...

But then when I use describeType on Vector.<Number>, Vector.<uint> and Vector.<int>.

<type name="__AS3__.vec::Vector.<Number>" base="Object" isDynamic="true" isFinal="true" isStatic="false">
<extendsClass type="Object"/>
<constructor>

[code]....

Now I have accounted for these 3 vectors individually as even uint and int does not extend Vector.<Number> as I would have expected.
And my parsing function works for all types correctly again. But my confusion comes as to WHY this is the case, and why I couldn't find any documentation on the subject.

View 1 Replies

Actionscript 3 :: Flex3 - Convert One Vector Data To Another Vector Data?

Mar 11, 2011

Class ShootGame implements IGame{

[Code]...

View 1 Replies

ActionScript 3.0 :: Pushing Point Locations Into An Array - Point(x,y) Conversion Faillure?

Dec 9, 2011

Im pushing Point locations into an array to Shift em out later. like this:

tempmoves.push([new Point(roundx,roundy)]);
..
ob.movestoplayer = tempmoves;[code]....

What am i doing wrong?

View 8 Replies

ActionScript 2.0 :: Movieclip To Move Along The X-axis To A Certain Point And Then Back To The Starting Point Again?

Apr 12, 2007

It's been a long time since I've done any work with actionscript, and alas I've forgotten nearly everything. I've tried to look for a tutorial that would explain basic animation with actionscript, but the one that I found on Kirupa was no longer there.

Basically I'd like to do this:On the stage I have a movieclip and I'd like the movieclip to move along the x-axis to a certain point and then back to the starting point again. The moving speed of the movieclip should also be adjustable.

View 8 Replies

ActionScript 3.0 :: Distance From Point To Point And Referencing Other Instances Of The Same Class

Feb 8, 2009

I'm creating a game in flash for a university project, and learning actionscript and programming as I go. I'm very much still at a beginner level - at the moment al I have is some actionscript for drawing rectangles and moving them about the screen. This is what I'm having trouble with at the moment: I have a class called 'Creature', and I want instances of it to interact with each other. I want them to do something when they come within a certain distance of another instance. And I want them to be able to pick a random other instance to get the location of, in order to do something with that information.

What I think I need is: A function for telling the distance between two (x,y) points.
A way of referencing the nearest other instance of the class. And a way of randomly selecting from all of the instances of the class.

View 4 Replies

Flash :: Perspective Projection Formula - Convert 3d Point To 2d Point?

Mar 27, 2011

How to convert 3d point to 2d point? I've found next formula in Internet(camera is situated in origin)

[Code]....

But these formulae give me strange result when z are less than zero(z<0) I need build line from A(100,100,100) to B (100,100;-100) As you can see these equations give really strange result when I try to convert B point in 2D dimension

View 1 Replies

Actionscript 3 :: Moving A Point With Rotation Doesn't Change The Point XY?

Jul 15, 2011

i have the follow issue :

I have a point which is setted at the border on a component, with changed transform point to the center of a component in order to match the component rotation.

the important part is when i try to get the point XY after rotation - they remains the same as before rotation.

how to get XY, after rotation ( changeing point.rotation property to specific degrees of rotaion )

View 2 Replies

ActionScript 2.0 :: A Line From One Point Past Another Point And Whether It Hits An Object?

Aug 19, 2009

I am using AS2 with Flash 8 Professional So, my problem is that I currently have a man in the middle of the screen, who shoots a line towards the mouse when I click. However, when I use hitTest to see if the line collides with another object, Flash recognizes the line as a large box if it is diagonal, so the hitTest isn't very accurate. The line only satys there for one frame, so I can't have the usual moving-bullet-style. I am either looking for a way to create an imaginary line with AS from the starting point to the mouse and beyond, and tell whether or not this line intersects with an object... or some other way that I haven't thought of to fix my problem. Keep in mind that the line rotates from a center point towards anywhere around it for 360 degrees.

View 1 Replies

ActionScript 3.0 :: Find Egistration Point Compared To Its Top Left Point

Aug 20, 2009

if i have a movieclip or a sprite could i find (via code) where is its registration point compared to its top left point (no rotation included) ?

View 4 Replies

ActionScript 2.0 :: Smooth Preload Bar - Appears To Jump From Point To Point

Apr 27, 2004

my preloader bar isn't growing smoothly. it appears to jump from point to point -- and i want to make it smooth. you can see the example here at: [URL] would anyone mind taking a quick look at the file i've attached,

View 6 Replies

ActionScript 2.0 :: Find An Angle From An Anchor Point And A Moving Point?

Feb 19, 2005

I know some basic trig. but how do i find an angle from an anchor point and a moving point?

adjecent = _root.anchor._x-_root._xmouse;
opposite = _root.anchor._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved