Search Results

Search found 9031 results on 362 pages for 'permanent position'.

Page 11/362 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Collision detection problems...

    - by thyrgle
    Hi, I have written the following: -(void) checkIfLineCollidesWithAll { float slope = ((160-L1Circle1.position.y)-(160-L1Circle2.position.y))/((240-L1Circle1.position.x)-(240-L1Circle2.position.x)); float b = (160-L1Circle1.position.y) - slope * (240-L1Circle1.position.x); if ((240-L1Sensor1.position.x) < (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) < (240-L1Circle2.position.x) || ((240-L1Sensor1.position.x) > (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) > (240-L1Circle2.position.x))) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } else if (slope == INFINITY || slope == -INFINITY) { if (L1Circle1.position.y + 16 >= L1Sensor1.position.y || L1Circle1.position.y - 16 <= L1Sensor1.position.y) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } else if (160-L1Sensor1.position.y + 12 >= slope*(240-L1Sensor1.position.x) + b && 160-L1Sensor1.position.y - 12 <= slope*(240-L1Sensor1.position.x) + b) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } Basically what this does is finds m and b in the well known equation: y = mx + b and then substitutes coordinates of the L1Sensor1 (the circle I'm trying to detect if it it intersects with the line segment) to see if y = mx + b hold true. But, there are two problems, first, when slope approaches infinity the range of what the L1Sensor1 should "react" to (it "reacts" by changing its image) becomes smaller. Also, the code that should handle infinity is not working. Thanks for the help in advanced.

    Read the article

  • iphone - making the CGAffineTransform permanent

    - by Mike
    I am banging my head on the wall here due to this problem: When I create a UIImageView this view has a certain orientation and size. Lets call this state "A". This view responds to taps. It can be dragged around the screen. At some point in the code I apply a CGAffineTransform to the view. Does not matter if the affine is a scale, a rotation, a translation or a combination of all. Does not matter also if the transform is absolute or relative. Not to mention the device can change its orientation and the view is autorotated to the correct orientation (that we can cay is a kind of rotation or transformation applied to the view). The problem is: the moment I touch that object or try to animate its transparency or any other parameter, it "remembers" the state "A" and does all animations from that state, not from current state. If I simply touch the view, it returns instantly to state "A". The code is not doing it by itself. It is an annoying "gift" from Apple. How to I make a view assume its current state of transformations as the reset or initial state? In other words, how do I make a view forget its past transformations or states? The only way I know is recreating the view, but this is a ridiculous way of doing this. Is there any way to make this work as I described? thanks

    Read the article

  • get the start position of an item using the jquery ui sortable plugin

    - by Rippo
    I am using the jQuery UI sortable plugin and I am trying to get 2 alerts I want the staring position of the element and the finished position of the element. $(function() { $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) { alert(ui.item.prevAll().length + 1); } }); }); I can get the position of the item after it has been dragged by using:- ui.item.prevAll().length + 1 What do I use to get the position it started from?

    Read the article

  • get the start position of an item using the jquery ui sortable plugin

    - by Rippo
    I am using the jQuery UI sortable plugin and I am trying to get 2 alerts I want the staring position of the element and the finished position of the element. $(function() { $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) { alert(ui.item.prevAll().length + 1); } }); }); I can get the position of the item after it has been dragged by using:- ui.item.prevAll().length + 1 What do I use to get the position it started from?

    Read the article

  • Creating a "permanent" Cocoa object

    - by quixoto
    I have an object factory that hands out instances of certain "constant" objects. I'd like these objects to be protected against bad memory management by clients. This is how I've overridden the class's key methods. Am I missing anything (code or other considerations)? - (id)retain { return self; } - (NSUInteger)retainCount { return UINT_MAX; } - (void)release { // nothing. }

    Read the article

  • Permanent mutex locking causing deadlock?

    - by Daniel
    I am having a problem with mutexes (pthread_mutex on Linux) where if a thread locks a mutex right again after unlocking it, another thread is not very successful getting a lock. I've attached test code where one mutex is created, along with two threads that in an endless loop lock the mutex, sleep for a while and unlock it again. The output I expect to see is "alive" messages from both threads, one from each (e.g. 121212121212. However what I get is that one threads gets the majority of locks (e.g. 111111222222222111111111 or just 1111111111111...). If I add a usleep(1) after the unlocking, everything works as expected. Apparently when the thread goes to SLEEP the other thread gets its lock - however this is not the way I was expecting it, as the other thread has already called pthread_mutex_lock. I suspect this is the way this is implemented, in that the actice thread has priority, however it causes certain problem in this particular testcase. Is there any way to prevent it (short of adding a deliberately large enough delay or some kind of signaling) or where is my error in understanding? #include <pthread.h> #include <stdio.h> #include <string.h> #include <sys/time.h> #include <unistd.h> pthread_mutex_t mutex; void* threadFunction(void *id) { int count=0; while(true) { pthread_mutex_lock(&mutex); usleep(50*1000); pthread_mutex_unlock(&mutex); // usleep(1); ++count; if (count % 10 == 0) { printf("Thread %d alive\n", *(int*)id); count = 0; } } return 0; } int main() { // create one mutex pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutex_init(&mutex, &attr); // create two threads pthread_t thread1; pthread_t thread2; pthread_attr_t attributes; pthread_attr_init(&attributes); int id1 = 1, id2 = 2; pthread_create(&thread1, &attributes, &threadFunction, &id1); pthread_create(&thread2, &attributes, &threadFunction, &id2); pthread_attr_destroy(&attributes); sleep(1000); return 0; }

    Read the article

  • apache mod_rewrite making permanent url problem

    - by Yc Zhang
    In file .htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^\/*get_post\/(.*)$ get_post.php?slug=$0 [L] </IfModule> If I type http://example.com/get_post/abcde, I get an empty array of $_GET variable. How can I achieve the effect like this: http://example.com/get_post?slug=abcde

    Read the article

  • Linux: programatically setting a permanent environment variable

    - by Richard
    Hello All, I am writing a little install script for some software. All it does is unpack a target tar, and then i want to permanently set some environment variables - principally the location of the unpacked libs and updating $PATH. Do I need to programmatically edit the .bashrc file, adding the appropriate entries to the end for example, or is there another way? What's standard practice? Thanks

    Read the article

  • Hudson authentication via wget is return http error 302

    - by Rafael
    Hello, I'm trying to make a script to authenticate in hudson using wget and store the authentication cookie. The contents of the script is this: wget \ --no-check-certificate \ --save-cookies /home/hudson/hudson-authentication-cookie \ --output-document "-" \ 'https://myhudsonserver:8443/hudson/j_acegi_security_check?j_username=my_username&j_password=my_password&remember_me=true' Unfortunately, when I run this script, I get: --2011-02-03 13:39:29-- https://myhudsonserver:8443/hudson/j_acegi_security_check? j_username=my_username&j_password=my_password&remember_me=true Resolving myhudsonserver... 127.0.0.1 Connecting to myhudsonserver|127.0.0.1|:8443... connected. WARNING: cannot verify myhudsonserver's certificate, issued by `/C=Unknown/ST=Unknown/L=Unknown/O=Unknown/OU=Unknown/CN=myhudsonserver': Self-signed certificate encountered. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://myhudson:8443/hudson/;jsessionid=087BD0B52C7A711E0AD7B8BD4B47585F [following] --2011-02-03 13:39:29-- https://myhudsonserver:8443/hudson/;jsessionid=087BD0B52C7A711E0AD7B8BD4B47585F Reusing existing connection to myhudsonserver:8443. HTTP request sent, awaiting response... 404 Not Found 2011-02-03 13:39:29 ERROR 404: Not Found. There's no error log in any of hudson's tomcat log files. Does anyone has any idea about what might be happening? Thanks.

    Read the article

  • Make Windows Position Your Dual Monitors Correctly

    - by Mysticgeek
    If you have a dual monitor setup and each monitor is a different size or height, it can be annoying trying to move the mouse pointer between them. Here is a quick tip that will help make the process easier. Align Monitors In our example, we’re using Windows 7, but the process is essentially the same in all versions, but getting to Display Settings is different. In Windows 7 open the Start menu and type display settings into the search box and hit Enter. In Vista right-click the desktop and click Personalize. Then from the Personalize appearance and sounds menu click on Display Settings. In XP right-click on the desktop and select Properties then in Display Properties click the Settings tab. Now here is where you can change the appearance of your monitors. In this example we have a larger 22” LCD and a smaller 19” and it can be annoying getting the mouse pointer from one to another depending where you are on each monitor. So what you want to do is simply move each display around to a particular height so it’s easier to get the pointer over. For example with this setting we know we’ll have no problem moving the pointer to the other screen at the top of each display.   Of course here you can flip your monitors around, change the display resolution, orientation, etc. If you have dual monitors where one might be larger or set up higher than the other, then this is a great way to get them finely tuned. You will have to play around with the settings a bit to settle on what works best for you. Similar Articles Productive Geek Tips GeekNewb: Get to Know These Windows 7 HotkeysDual Monitors: Use a Different Wallpaper on Each DesktopSet Windows as Default OS when Dual Booting UbuntuEasily Set Default OS in a Windows 7 / Vista and XP Dual-boot SetupSet XP as the Default OS in a Windows Vista Dual-Boot Setup TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Download Wallpapers From National Geographic Site Spyware Blaster v4.3 Yes, it’s Patch Tuesday Generate Stunning Tag Clouds With Tagxedo Install, Remove and HIDE Fonts in Windows 7 Need Help with Your Home Network?

    Read the article

  • Deferred rendering with VSM - Scaling light depth loses moments

    - by user1423893
    I'm calculating my shadow term using a VSM method. This works correctly when using forward rendered lights but fails with deferred lights. // Shadow term (1 = no shadow) float shadow = 1; // [Light Space -> Shadow Map Space] // Transform the surface into light space and project // NB: Could be done in the vertex shader, but doing it here keeps the // "light shader" abstraction and doesn't limit the number of shadowed lights float4x4 LightViewProjection = mul(LightView, LightProjection); float4 surf_tex = mul(position, LightViewProjection); // Re-homogenize // 'w' component is not used in later calculations so no need to homogenize (it will equal '1' if homogenized) surf_tex.xyz /= surf_tex.w; // Rescale viewport to be [0,1] (texture coordinate system) float2 shadow_tex; shadow_tex.x = surf_tex.x * 0.5f + 0.5f; shadow_tex.y = -surf_tex.y * 0.5f + 0.5f; // Half texel offset //shadow_tex += (0.5 / 512); // Scaled distance to light (instead of 'surf_tex.z') float rescaled_dist_to_light = dist_to_light / LightAttenuation.y; //float rescaled_dist_to_light = surf_tex.z; // [Variance Shadow Map Depth Calculation] // No filtering float2 moments = tex2D(ShadowSampler, shadow_tex).xy; // Flip the moments values to bring them back to their original values moments.x = 1.0 - moments.x; moments.y = 1.0 - moments.y; // Compute variance float E_x2 = moments.y; float Ex_2 = moments.x * moments.x; float variance = E_x2 - Ex_2; variance = max(variance, Bias.y); // Surface is fully lit if the current pixel is before the light occluder (lit_factor == 1) // One-tailed inequality valid if float lit_factor = (rescaled_dist_to_light <= moments.x - Bias.x); // Compute probabilistic upper bound (mean distance) float m_d = moments.x - rescaled_dist_to_light; // Chebychev's inequality float p = variance / (variance + m_d * m_d); p = ReduceLightBleeding(p, Bias.z); // Adjust the light color based on the shadow attenuation shadow *= max(lit_factor, p); This is what I know for certain so far: The lighting is correct if I do not try and calculate the shadow term. (No shadows) The shadow term is correct when calculated using forward rendered lighting. (VSM works with forward rendered lights) With the current rescaled light distance (lightAttenuation.y is the far plane value): float rescaled_dist_to_light = dist_to_light / LightAttenuation.y; The light is correct and the shadow appears to be zoomed in and misses the blurring: When I do not rescale the light and use the homogenized 'surf_tex': float rescaled_dist_to_light = surf_tex.z; the shadows are blurred correctly but the lighting is incorrect and the cube model is no longer lit Why is scaling by the far plane value (LightAttenuation.y) zooming in too far? The only other factor involved is my world pixel position, which is calculated as follows: // [Position] float4 position; // [Screen Position] position.xy = input.PositionClone.xy; // Use 'x' and 'y' components already homogenized for uv coordinates above position.z = tex2D(DepthSampler, texCoord).r; // No need to homogenize 'z' component position.z = 1.0 - position.z; position.w = 1.0; // 1.0 = position.w / position.w // [World Position] position = mul(position, CameraViewProjectionInverse); // Re-homogenize position (xyz AND w, otherwise shadows will bend when camera is close) position.xyz /= position.w; position.w = 1.0; Using the inverse matrix of the camera's view x projection matrix does work for lighting but maybe it is incorrect for shadow calculation? EDIT: Light calculations for shadow including 'dist_to_light' // Work out the light position and direction in world space float3 light_position = float3(LightViewInverse._41, LightViewInverse._42, LightViewInverse._43); // Direction might need to be negated float3 light_direction = float3(-LightViewInverse._31, -LightViewInverse._32, -LightViewInverse._33); // Unnormalized light vector float3 dir_to_light = light_position - position; // Direction from vertex float dist_to_light = length(dir_to_light); // Normalise 'toLight' vector for lighting calculations dir_to_light = normalize(dir_to_light); EDIT2: These are the calculations for the moments (depth) //============================================= //---[Vertex Shaders]-------------------------- //============================================= DepthVSOutput depth_VS( float4 Position : POSITION, uniform float4x4 shadow_view, uniform float4x4 shadow_view_projection) { DepthVSOutput output = (DepthVSOutput)0; // First transform position into world space float4 position_world = mul(Position, World); output.position_screen = mul(position_world, shadow_view_projection); output.light_vec = mul(position_world, shadow_view).xyz; return output; } //============================================= //---[Pixel Shaders]--------------------------- //============================================= DepthPSOutput depth_PS(DepthVSOutput input) { DepthPSOutput output = (DepthPSOutput)0; // Work out the depth of this fragment from the light, normalized to [0, 1] float2 depth; depth.x = length(input.light_vec) / FarPlane; depth.y = depth.x * depth.x; // Flip depth values to avoid floating point inaccuracies depth.x = 1.0f - depth.x; depth.y = 1.0f - depth.y; output.depth = depth.xyxy; return output; } EDIT 3: I have tried the folloiwng: float4 pp; pp.xy = input.PositionClone.xy; // Use 'x' and 'y' components already homogenized for uv coordinates above pp.z = tex2D(DepthSampler, texCoord).r; // No need to homogenize 'z' component pp.z = 1.0 - pp.z; pp.w = 1.0; // 1.0 = position.w / position.w // Determine the depth of the pixel with respect to the light float4x4 LightViewProjection = mul(LightView, LightProjection); float4x4 matViewToLightViewProj = mul(CameraViewProjectionInverse, LightViewProjection); float4 vPositionLightCS = mul(pp, matViewToLightViewProj); float fLightDepth = vPositionLightCS.z / vPositionLightCS.w; // Transform from light space to shadow map texture space. float2 vShadowTexCoord = 0.5 * vPositionLightCS.xy / vPositionLightCS.w + float2(0.5f, 0.5f); vShadowTexCoord.y = 1.0f - vShadowTexCoord.y; // Offset the coordinate by half a texel so we sample it correctly vShadowTexCoord += (0.5f / 512); //g_vShadowMapSize This suffers the same problem as the second picture. I have tried storing the depth based on the view x projection matrix: output.position_screen = mul(position_world, shadow_view_projection); //output.light_vec = mul(position_world, shadow_view); output.light_vec = output.position_screen; depth.x = input.light_vec.z / input.light_vec.w; This gives a shadow that has lots surface acne due to horrible floating point precision errors. Everything is lit correctly though. EDIT 4: Found an OpenGL based tutorial here I have followed it to the letter and it would seem that the uv coordinates for looking up the shadow map are incorrect. The source uses a scaled matrix to get the uv coordinates for the shadow map sampler /// <summary> /// The scale matrix is used to push the projected vertex into the 0.0 - 1.0 region. /// Similar in role to a * 0.5 + 0.5, where -1.0 < a < 1.0. /// <summary> const float4x4 ScaleMatrix = float4x4 ( 0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0 ); I had to negate the 0.5 for the y scaling (M22) in order for it to work but the shadowing is still not correct. Is this really the correct way to scale? float2 shadow_tex; shadow_tex.x = surf_tex.x * 0.5f + 0.5f; shadow_tex.y = surf_tex.y * -0.5f + 0.5f; The depth calculations are exactly the same as the source code yet they still do not work, which makes me believe something about the uv calculation above is incorrect.

    Read the article

  • Movement and Collision with AABB

    - by Jeremy Giberson
    I'm having a little difficulty figuring out the following scenarios. http://i.stack.imgur.com/8lM6i.png In scenario A, the moving entity has fallen to (and slightly into the floor). The current position represents the projected position that will occur if I apply the acceleration & velocity as usual without worrying about collision. The Next position, represents the corrected projection position after collision check. The resulting end position is the falling entity now rests ON the floor--that is, in a consistent state of collision by sharing it's bottom X axis with the floor's top X axis. My current update loop looks like the following: // figure out forces & accelerations and project an objects next position // check collision occurrence from current position -> projected position // if a collision occurs, adjust projection position Which seems to be working for the scenario of my object falling to the floor. However, the situation becomes sticky when trying to figure out scenario's B & C. In scenario B, I'm attempt to move along the floor on the X axis (player is pressing right direction button) additionally, gravity is pulling the object into the floor. The problem is, when the object attempts to move the collision detection code is going to recognize that the object is already colliding with the floor to begin with, and auto correct any movement back to where it was before. In scenario C, I'm attempting to jump off the floor. Again, because the object is already in a constant collision with the floor, when the collision routine checks to make sure moving from current position to projected position doesn't result in a collision, it will fail because at the beginning of the motion, the object is already colliding. How do you allow movement along the edge of an object? How do you allow movement away from an object you are already colliding with. Extra Info My collision routine is based on AABB sweeping test from an old gamasutra article, http://www.gamasutra.com/view/feature/3383/simple_intersection_tests_for_games.php?page=3 My bounding box implementation is based on top left/bottom right instead of midpoint/extents, so my min/max functions are adjusted. Otherwise, here is my bounding box class with collision routines: public class BoundingBox { public XYZ topLeft; public XYZ bottomRight; public BoundingBox(float x, float y, float z, float w, float h, float d) { topLeft = new XYZ(); bottomRight = new XYZ(); topLeft.x = x; topLeft.y = y; topLeft.z = z; bottomRight.x = x+w; bottomRight.y = y+h; bottomRight.z = z+d; } public BoundingBox(XYZ position, XYZ dimensions, boolean centered) { topLeft = new XYZ(); bottomRight = new XYZ(); topLeft.x = position.x; topLeft.y = position.y; topLeft.z = position.z; bottomRight.x = position.x + (centered ? dimensions.x/2 : dimensions.x); bottomRight.y = position.y + (centered ? dimensions.y/2 : dimensions.y); bottomRight.z = position.z + (centered ? dimensions.z/2 : dimensions.z); } /** * Check if a point lies inside a bounding box * @param box * @param point * @return */ public static boolean isPointInside(BoundingBox box, XYZ point) { if(box.topLeft.x <= point.x && point.x <= box.bottomRight.x && box.topLeft.y <= point.y && point.y <= box.bottomRight.y && box.topLeft.z <= point.z && point.z <= box.bottomRight.z) return true; return false; } /** * Check for overlap between two bounding boxes using separating axis theorem * if two boxes are separated on any axis, they cannot be overlapping * @param a * @param b * @return */ public static boolean isOverlapping(BoundingBox a, BoundingBox b) { XYZ dxyz = new XYZ(b.topLeft.x - a.topLeft.x, b.topLeft.y - a.topLeft.y, b.topLeft.z - a.topLeft.z); // if b - a is positive, a is first on the axis and we should use its extent // if b -a is negative, b is first on the axis and we should use its extent // check for x axis separation if ((dxyz.x >= 0 && a.bottomRight.x-a.topLeft.x < dxyz.x) // negative scale, reverse extent sum, flip equality ||(dxyz.x < 0 && b.topLeft.x-b.bottomRight.x > dxyz.x)) return false; // check for y axis separation if ((dxyz.y >= 0 && a.bottomRight.y-a.topLeft.y < dxyz.y) // negative scale, reverse extent sum, flip equality ||(dxyz.y < 0 && b.topLeft.y-b.bottomRight.y > dxyz.y)) return false; // check for z axis separation if ((dxyz.z >= 0 && a.bottomRight.z-a.topLeft.z < dxyz.z) // negative scale, reverse extent sum, flip equality ||(dxyz.z < 0 && b.topLeft.z-b.bottomRight.z > dxyz.z)) return false; // not separated on any axis, overlapping return true; } public static boolean isContactEdge(int xyzAxis, BoundingBox a, BoundingBox b) { switch(xyzAxis) { case XYZ.XCOORD: if(a.topLeft.x == b.bottomRight.x || a.bottomRight.x == b.topLeft.x) return true; return false; case XYZ.YCOORD: if(a.topLeft.y == b.bottomRight.y || a.bottomRight.y == b.topLeft.y) return true; return false; case XYZ.ZCOORD: if(a.topLeft.z == b.bottomRight.z || a.bottomRight.z == b.topLeft.z) return true; return false; } return false; } /** * Sweep test min extent value * @param box * @param xyzCoord * @return */ public static float min(BoundingBox box, int xyzCoord) { switch(xyzCoord) { case XYZ.XCOORD: return box.topLeft.x; case XYZ.YCOORD: return box.topLeft.y; case XYZ.ZCOORD: return box.topLeft.z; default: return 0f; } } /** * Sweep test max extent value * @param box * @param xyzCoord * @return */ public static float max(BoundingBox box, int xyzCoord) { switch(xyzCoord) { case XYZ.XCOORD: return box.bottomRight.x; case XYZ.YCOORD: return box.bottomRight.y; case XYZ.ZCOORD: return box.bottomRight.z; default: return 0f; } } /** * Test if bounding box A will overlap bounding box B at any point * when box A moves from position 0 to position 1 and box B moves from position 0 to position 1 * Note, sweep test assumes bounding boxes A and B's dimensions do not change * * @param a0 box a starting position * @param a1 box a ending position * @param b0 box b starting position * @param b1 box b ending position * @param aCollisionOut xyz of box a's position when/if a collision occurs * @param bCollisionOut xyz of box b's position when/if a collision occurs * @return */ public static boolean sweepTest(BoundingBox a0, BoundingBox a1, BoundingBox b0, BoundingBox b1, XYZ aCollisionOut, XYZ bCollisionOut) { // solve in reference to A XYZ va = new XYZ(a1.topLeft.x-a0.topLeft.x, a1.topLeft.y-a0.topLeft.y, a1.topLeft.z-a0.topLeft.z); XYZ vb = new XYZ(b1.topLeft.x-b0.topLeft.x, b1.topLeft.y-b0.topLeft.y, b1.topLeft.z-b0.topLeft.z); XYZ v = new XYZ(vb.x-va.x, vb.y-va.y, vb.z-va.z); // check for initial overlap if(BoundingBox.isOverlapping(a0, b0)) { // java pass by ref/value gotcha, have to modify value can't reassign it aCollisionOut.x = a0.topLeft.x; aCollisionOut.y = a0.topLeft.y; aCollisionOut.z = a0.topLeft.z; bCollisionOut.x = b0.topLeft.x; bCollisionOut.y = b0.topLeft.y; bCollisionOut.z = b0.topLeft.z; return true; } // overlap min/maxs XYZ u0 = new XYZ(); XYZ u1 = new XYZ(1,1,1); float t0, t1; // iterate axis and find overlaps times (x=0, y=1, z=2) for(int i = 0; i < 3; i++) { float aMax = max(a0, i); float aMin = min(a0, i); float bMax = max(b0, i); float bMin = min(b0, i); float vi = XYZ.getCoord(v, i); if(aMax < bMax && vi < 0) XYZ.setCoord(u0, i, (aMax-bMin)/vi); else if(bMax < aMin && vi > 0) XYZ.setCoord(u0, i, (aMin-bMax)/vi); if(bMax > aMin && vi < 0) XYZ.setCoord(u1, i, (aMin-bMax)/vi); else if(aMax > bMin && vi > 0) XYZ.setCoord(u1, i, (aMax-bMin)/vi); } // get times of collision t0 = Math.max(u0.x, Math.max(u0.y, u0.z)); t1 = Math.min(u1.x, Math.min(u1.y, u1.z)); // collision only occurs if t0 < t1 if(t0 <= t1 && t0 != 0) // not t0 because we already tested it! { // t0 is the normalized time of the collision // then the position of the bounding boxes would // be their original position + velocity*time aCollisionOut.x = a0.topLeft.x + va.x*t0; aCollisionOut.y = a0.topLeft.y + va.y*t0; aCollisionOut.z = a0.topLeft.z + va.z*t0; bCollisionOut.x = b0.topLeft.x + vb.x*t0; bCollisionOut.y = b0.topLeft.y + vb.y*t0; bCollisionOut.z = b0.topLeft.z + vb.z*t0; return true; } else return false; } }

    Read the article

  • New Year, New Position, New Opportunity and Adventures!

    - by D'Arcy Lussier
    2010 was an incredible year of change for me. On the personal side, we celebrated our youngest daughter’s first birthday and welcomed my oldest daughter into our family (both my girls are adopted). Professionally, I put on the first ever Prairie Developer Conference, the 3rd annual Winnipeg Code Camp, the Software Development and Evolution Conference, continued to build the technology community in Winnipeg, was awarded a Microsoft MVP award for the 4th year, created a certification program to help my employer, Protegra, attain Microsoft Partner status, and had great project work throughout the year. So now its 2011, and I’m looking ahead to new challenges and opportunities with a new employer. Starting in mid February I’ll be the Microsoft Practice Lead with Online Business Systems, a Microsoft partner here in Winnipeg! I’m very excited about working with such great people and helping continue delivering quality solutions and consulting that the organization has become known for. 2010 was great, but 2011 is shaping up to be a banner year both personally and professionally!

    Read the article

  • Saving Dragged Dropped items position on postback in asp.net [closed]

    - by Deeptechtons
    Ok i saw many post's on how to serialize the value of dragged items to get hash and they tell how to save them. Now the question is how do i persist the dragged items the next time when user log's in using the has value that i got eg: <ul class="list"> <li id="id_1"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_2"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_3"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_4"> <div class="item ui-corner-all ui-widget"> </div> </li> </ul> which on serialize will give "id[]=1&id[]=2&id[]=3&id[]=4" Now think that i saved it to Sql server database in a single field called SortOrder. Now how do i get the items to these order again ? the code to make these sort is below,without which people didn't know which library i had used to sort and serialize <script type="text/javascript"> $(document).ready(function() { $(".list li").css("cursor", "move"); $(".list").sortable(); }); </script>

    Read the article

  • Skills to Focus on to land Big 5 Software Engineer Position

    - by Megadeth.Metallica
    Guys, I'm in my penultimate quarter of grad school and have a software engineering internship lined up at a big 5 tech company. I have dabbled a lot recently in Python and am average at Java. I want to prepare myself for coding interviews when I apply for new grad positions at the Big 5 tech companies when I graduate at the end of this year. Since I want to have a good shot at all 5 companies (Amazon,Google,Yahoo,Microsoft and Apple) - Should I focus my time and effort on mastering and improving my Java. Or is my time better spent checking out other languages and tools ( Attracted to RoR, Clojure, Git, C# ) I am planning to spend my spring break implementing all the common algorithms and Data structure out of my algorithms textbook in Java.

    Read the article

  • All About Search Engine Position Optimization

    Search engine optimization or SEO is a method increasing the amount of traffic or hits to your website, which results in making your website rank high in search engine results. These results are produced whenever an individual types in a keyword or a set of keywords in a search query in search engines like Yahoo!, Google and the like. Being high on the list of search results matters a lot because it makes you more visible to the general public, especially to your target market. This differentiates you from your competitors who may rank low in the search results, or may not even appear in the results lists at all.

    Read the article

  • Gnome - windows always open top left

    - by BobTodd
    I find this a highly annoying "feature" on a wide screen monitor that my mostly used apps - terminal and gedit always open directly under the top-left corner of my screen and I have to drag them to my eye position each and every-time. I have tried installing the CompizConfig Settings Manager and using the feature to position windows centre, but this has had no effect - the force feature here isn't working for me either. I can use e.g. gnome-terminal --geometry=140x50+50+50 for the terminal but this doesn't work for gedit. Any ideas? Thanks

    Read the article

  • Search Engine Promotion Techniques For Increasing Your Site Position

    Content and website optimization is the meat and potatoes of your SEO campaign, and search engine promotion is the stew. When looking at other SEO campaigns in your niche it can seem like quality is not key when it comes to rankings, but creating quality content to place on your website and to use for promotional purposes will give you a steadfast placement in the search engine rankings.

    Read the article

  • Blender 2.63a window position unstable with dual monitor extended desktop

    - by Steve Smith
    I have two 1920 x 1200 HP monitors and running Ubuntu 12.10. If I set them up as an extended desktop, (both 1280 x 1024 positioned for 2048 x 1280, all my applications work fine EXCEPT Blender (even Inkscape). Blender works great on a single monitor but always defaults to a window size that uses all available real estate and it can't do that with 2048 x 1280. It launches, but jumps all over the screen. Does any know a way to start Blender in a fixed size window so it would run in just one monitor?

    Read the article

  • get stick analogue XY position using Jinput in lwjgl

    - by oIrC
    i want to capture the movement of the analogue stick of the gamePad. is there any equivalent function to this public void mouseMoved(MouseEvent mouseEvent) { mouseEvent.getX(); //return the X coordinate of the cursor inside a component mouseEvent.getY();//return the Y coordinate of the cursor inside a component } into lwjgl.input.Controllers, i found controller.getAxisValue() but this one doesn't work as the function above. any help? thanks.

    Read the article

  • Mit Oracle Datenbanken in die Pole-Position!

    - by Alliances & Channels Redaktion
    Stellen Sie sich vor, Sie haben die Wahl zwischen einem hübschen, aber uralten Kleinwagen und einem stylischen Tourenwagen auf technischem Höchststand. Beide haben etwas für sich, keine Frage, doch auf der Rennstrecke, wo es allein um Performance geht, ist Nostalgie fehl am Platz. Nicht anders ist es mit Datenbanken. Wer also Wert auf Leistung, Sicherheit und die optimale Ausnutzung von Hardware und IT-Ressourcen legt, sollte sich für ein Database-Tuning entscheiden. Die wesentlichen Vorteile der Oracle Datenbanken bringt dieses Video kurz und knackig auf den Punkt – und ist damit auch bestens zum Einsatz bei Kunden geeignet. Oracle Database Tuning from Worm Marketing Consulting GmbH on Vimeo.

    Read the article

  • Mit Oracle Datenbanken in die Pole-Position!

    - by Alliances & Channels Redaktion
    Stellen Sie sich vor, Sie haben die Wahl zwischen einem hübschen, aber uralten Kleinwagen und einem stylischen Tourenwagen auf technischem Höchststand. Beide haben etwas für sich, keine Frage, doch auf der Rennstrecke, wo es allein um Performance geht, ist Nostalgie fehl am Platz. Nicht anders ist es mit Datenbanken. Wer also Wert auf Leistung, Sicherheit und die optimale Ausnutzung von Hardware und IT-Ressourcen legt, sollte sich für ein Database-Tuning entscheiden. Die wesentlichen Vorteile der Oracle Datenbanken bringt dieses Video kurz und knackig auf den Punkt – und ist damit auch bestens zum Einsatz bei Kunden geeignet. Oracle Database Tuning from Worm Marketing Consulting GmbH on Vimeo.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >