Search Results

Search found 1416 results on 57 pages for 'maximilian v3'.

Page 7/57 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Assign PowerShell script to run at startup using PowerShell on Window Server 2012

    - by James Toyer
    I'm trying to write a PowerShell script that will run when a Windows 2012 instance is created on AWS using the configuration tools provided by AWS. My problem is that I want to change the name of the machine once it has started up, restart the machine and carry on set up process after. The main reason for this is that one of the applications, Boundary, installed in the set up process takes the name of the server when first installed. It is then doesn't seem possible to change it's name in their portal. Ideally I would have two PowerShell scripts, one to start the set up process, initialised through AWS and another that runs the first time the machine restarts. This second script would ideally be queued to run on the next start by the initial set up script. So I guess my question are: Is this possible? How would I go about doing this. My Google foo is letting me down here so any answers would be appreciated.

    Read the article

  • Kohana v3, automatically escape illegal characters?

    - by Dom
    Quick question, does Kohana (version 3) automatically escape data that is passed into ORM::factory..... (and everywhere else that has to do with the database)? For example: $thread = ORM::factory('thread', $this->request->param('id')); Would the data passed in the second argument be auto-escaped before it goes in the SQL query or do I have to manually do it? Probably a stupid question and it's better to be safe than sorry, but yeah... I usually do manually escape the data, but I want to know if Kohana does this for me? Thanks

    Read the article

  • [PHP] Kohana-v3 ORM parent relationship

    - by VDVLeon
    Hi all, I just started with the version 3 of the Kohana Framework. I have worked a little with the $_has_many etc. Now I have the table pages. The primary key is pageID. The table has a column called parentPageID. Now I want to make a ORM model who, when accesed like this $page->parent->find() returns the page identified by parentPageID. I have the following already: // Settings protected $_table_name = 'pages'; protected $_primary_key = 'pageID'; protected $_has_one = array( 'parent' => array( 'model' => 'page', 'foreign_key' => 'parentPageID', ), ); But that does not work, it simply returns the first page from the table. Last query says this: SELECT `pages`.* FROM `pages` ORDER BY `pages`.`pageID` ASC LIMIT 1 Does somebody know how to solve this? I know this can: $parent = $page->parent->find($page->parentPageID); but it must be and can be cleaner (I think).

    Read the article

  • Closing InfoWindow with Google Maps API V3

    - by Oscar Godson
    I've seen the other posts, but they dont have the markers being looped through dynamically like mine. How do I create an event that will close the infowindow when another marker is clicked on using the following code? $(function(){ var latlng = new google.maps.LatLng(45.522015,-122.683811); var settings = { zoom: 10, center: latlng, disableDefaultUI:false, mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("map_canvas"), settings); $.getJSON('api',function(json){ for (var property in json) { if (json.hasOwnProperty(property)) { var json_data = json[property]; var the_marker = new google.maps.Marker({ title:json_data.item.headline, map:map, clickable:true, position:new google.maps.LatLng( parseFloat(json_data.item.geoarray[0].latitude), parseFloat(json_data.item.geoarray[0].longitude) ) }); function buildHandler(map, marker, content) { return function() { var infowindow = new google.maps.InfoWindow({ content: '<div class="marker"><h1>'+content.headline+'</h1><p>'+content.full_content+'</p></div>' }); infowindow.open(map, marker); }; } new google.maps.event.addListener(the_marker, 'click',buildHandler(map, the_marker, {'headline':json_data.item.headline,'full_content':json_data.item.full_content})); } } }); });

    Read the article

  • Can't use Visual Studio 2008 Designer with MVVMLight V3 SP1

    - by mcauthorn
    I wish I knew what I did to cause this, but I cannot use the Visual Studio 2008 Designer at all with with MVVMLight templates. I receive a "Could not create an instance of type 'ViewModelLocator'. in any of my xaml pages. The application builds and runs fine but only the designer is broken. In the App.xaml is <Application x:Class="ExcelReportGenerator.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:ExcelReportGenerator.ViewModel" xmlns:res="clr-namespace:ExcelReportGenerator.Resources" Startup="Application_Startup" mc:Ignorable="d"> <Application.Resources> <!--Global View Model Locator--> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> </Application.Resources> I even receive the error when I create a brand new MVVMLight application. The interesting thing is if I use an express version of VS2010 I can view, edit and work in designer just fine. As much as I would love to go to VS2010, I can't right now convince IT to make that move.

    Read the article

  • Windows Device Emulator V3, windows 7 + Network

    - by Petoj
    Well im debugging a windows CE application from visual studio in the Windows Device Emulator, now to setup the network i go to File - Configure - Network, i enable a network card and press OK, then i get this message: "The required Virtual Machine Network Driver could not be found. Make sure that Virtual PC 2007 is installed. You can install Virtual PC 2007 from http://go.microsoft.com/fwlink/?linkid=46859" Im running windows 7 and got a built-in Virtual pc and i would rather not have 2 installed at the same time is there any way to get this network driver without installing virtual PC 2007?

    Read the article

  • Adding Street View controls (the two icons just above the +) to a Google Map (v3)

    - by AlexV
    It's probably something really simple, but I can't find it in the docs and I can't find a map with it to check it's source... I use version 3 of the API. I guess it's an something to add in myOptions? var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); Currently I only have dragging controls and the zoom pane controls. I would like to have the two Street View controls icons too. If you want full source, I'm using this example as a base (how would you add Street View controls to this example?).

    Read the article

  • Kohana v3, escape illegal characters?

    - by Dom
    Quick question, does Kohana (version 3) automatically escape data that is passed into ORM::factory..... (and everywhere else that has to do with the database)? For example: $thread = ORM::factory('thread', $this->request->param('id')); Would the data passed in the second argument be auto-escaped before it goes in the SQL query or do I have to manually do it? Probably a stupid question and it's better to be safe than sorry, but yeah... I usually do manually escape the data, but I want to know if Kohana does this for me? Thanks

    Read the article

  • Looping through Markers with Google Maps API v3 Problem

    - by Oscar Godson
    I'm not sure why this isn't working. I don't have any errors, but what happens is, no matter what marker I click on, it clicks the 3rd one (which is the last one out of 4 markers. Array starts at 0, obviously) and shows the number "3", which is correct for THAT one, but I'm not clicking that one. Here is most of my code, just not the array of [place-name, coordinates] (var locations, which you will see): function initialize() { var latlng = new google.maps.LatLng(45.522015,-122.683811); var settings = { zoom: 15, center: latlng, disableDefaultUI:true, mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("map_canvas"), settings); var infowindow = new Array(); var marker = new Array(); for(x in locations){ console.log(x); infowindow[x] = new google.maps.InfoWindow({content: x}); marker[x] = new google.maps.Marker({title:locations[x][0],map:map,position:locations[x][1]}); google.maps.event.addListener(marker[x], 'click', function() {infowindow[x].open(map,marker[x]);}); } } initialize() The console.log output is (its correct, and what i expect): 0 1 2 3 So, any ideas?

    Read the article

  • Closing any open info windows in google maps api v3

    - by hhj
    As the title states, on a given event (for me this happens to be upon opening a new google.maps.InfoWindow I want to be able to close any other currently open info windows. Right now, I can open many at a time..but I want only 1 open at a time. I am creating the info windows dynamically (i.e. I don't know ahead of time how many will be generated), so in the click event of the current info window (which is where I want all the other open ones closed) I don't have a reference to any of the other open info windows on which to call close(). I am wondering how I can achieve this. I am not an experienced JavaScript programmer so I don't know if I need to use reflection or something similar here. Would the best way be just to save all the references in some sort of collection, then loop through the list closing them all? Thanks.

    Read the article

  • Google Maps API v3 - Directions/Paths breaking KML Overlay Infowindows

    - by Douglas
    I'm in the end stages before content filling and then production on the Google Maps project I've been working on. A number of bugs and such have been thwarted, but this latest one has me relatively stumped. The demo map can be viewed here: http://dougglover.com/samples/finalProduct/ Everything works fine until you create a path using the Directions section(not to be confused with Get Directions). To reproduce the problem, play around with the map, click on a building or two, just to see the functionality. After ensuring that clicking on a building works(brings up an infowindow), choose two buildings to get directions to in the Directions area. It works great with the routing algorithm I've implemented, and the paths show up nicely, and intelligently. The problem being that you can't click buildings anymore to see their info. I'm assuming it has something to do with the z-index error popping up in the console, but I'm not sure how to handle that if it is the problem. Any guidance is greatly appreciated. :)

    Read the article

  • Google MAP API v3: Link markers to an external list

    - by meo
    Given is a database with locations, we feed those tho the google map api and all points are displayed. Now there is a list of this location right next to the google map. How can i link the places in the list to the dots on the map? Like this: http://www.local.ch/en/q/ubs.html I want to light up the point on the map on the list item hover and open the info-box by clicking on the list item. Can anyone point me into the right direction?

    Read the article

  • Google Map V3 Constants as Variables

    - by Beardy
    In the example below I am trying to update the map type depending on the value of the selected option type. Unfortunately it doesn't seem to load the maptype into the google.maps.MapTypeId which is frustrating. I have tried it as a string as well as var gmapsMapType = google.maps.MapTypeId.++maptype; and I feel I am missing something here. HTML <select id="maptype" name="maptype"> <option selected="selected" value="RoadMap">Road Map</option> <option value="Satellite">Satellite</option> <option value="Hybrid">Hybrid</option> <option value="Terrain">Terrain</option> </select> JQUERY var maptype = $('#maptype>option:selected').val().toUpperCase(); var gmapsMapType = google.maps.MapTypeId.+maptype; map.setMapTypeId(gmapsMapType); Help is appreciated.

    Read the article

  • Removing Directions markers from the Google Maps API V3

    - by anonymous
    To remove a normal marker from a map, I understand you simply call marker.setMap(null), but when implementing the Google Maps directions services, it automatically adds markers A and B onto the map ( calculating directions from point A to point B ). I do not have control over these markers, so I cannot remove them in the normal way. So how can I remove these markers (I have custom markers on the map instead)?

    Read the article

  • Problems with Directions API in Google Maps V3 and jQuery

    - by Karthik Kastury
    Hi, I'm trying to get Google Maps Directions API working with jQuery, and I have the following code.. http://pastebin.com/6jcGt706 Where #end is a select list in the HTML.. I'm Using jQuery 1.4.. I'm not sure as to what is going wrong.. Can you please help me with this... Would appreciate if any one could help me fix the problem with this.. Thanks!

    Read the article

  • Toggle Image Overlays in Google Maps API v3

    - by Douglas
    Hey guys. I've been building a small library for myself for a job I have at the moment building a map for a university. I've gotten pretty well everything I need in some basic form, but one thing has simply not been working, and is simply not giving me results. The university itself is sort of in a partnership with the neighboring college. It's been decided that both campuses should be included. I need to be able to toggle on/off the overlays of the campuses individually. i.e. Start with all campuses ON. User then turns OFF college campus, university overlay stays up. User can then turn it back on to display the college once more, or turn off the university as well, leaving no overlays. Here's a work in progress I'm doing at the moment: http://bgsweb.ca/maps/generator.html Basically, we need to take the one overlay, split it into multiple overlays, and enable the toggling of each individual overlay. Any assistance much appreciated!

    Read the article

  • glassfish v3 asadmin how to specify XA on connection factory

    - by NDK
    This worked in GFV2: $AS_HOME/bin/asadmin \ --host $AS_ADMIN_HOST \ --user $AS_ADMIN_USER \ --port $AS_ADMIN_PORT \ create-jms-resource \ --restype javax.jms.QueueConnectionFactory \ --description XA\ Queue\ Connection\ Factory \ --property Name=myXAQueueConnectionFactory:SupportsXA=true \ jms/myXAQueueConnectionFactory But the SupportsXA=true no longer works. Maybe I can't find it in the GFV3 manuals, nor can I find it via our friend Google: how to specify XA transactionality using asadmin to configure the factory? Anybody out there know how?

    Read the article

  • Google Maps API v3.9: Blurry custom markers when zooming

    - by Mike
    So it appears that Google have fixed the blurry map issue with the 3.9 / 3.10 API, which is great. But there's a new one with custom markers. As soon as you zoom in one level, the custom markers become corrupted / blurry. They rectify themselves if zooming out, although the process of zooming out also makes the markers slightly blurry. The 3.8 API does not exhibit this problem with custom markers. Here's a picture illustrating the problem (I suggest you open the image in a new tab; the blurriness isn't as easily visible when the image is scaled to fit this post). The blurring is most noticeable with the straight lines of the paper crane marker: I've had a prod through the HTML, but I can't really tell how the markers are placed on the map. But I thought that I'd put this issue out there for anyone who has experienced similar, or if anyone has any thoughts on how this can be resolved, save waiting to see if it's a glitch in the API.

    Read the article

  • Google maps api v3: geocoding multiple addresses and infowindow

    - by user2536786
    I am trying to get infowindow for multiple addresses. Its creating markers but when I click on markers, infowindow is not popping up. Please help and see what could be wrong in this code. Rest all info is fine only issue is with infowindow not coming up. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="height: 800px;"></div> <script type="text/javascript"> var locations = [ ['Bondi Beach', '850 Bay st 04 Toronto, Ont'], ['Coogee Beach', '932 Bay Street, Toronto, ON M5S 1B1'], ['Cronulla Beach', '61 Town Centre Court, Toronto, ON M1P'], ['Manly Beach', '832 Bay Street, Toronto, ON M5S 1B1'], ['Maroubra Beach', '606 New Toronto Street, Toronto, ON M8V 2E8'] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 10, center: new google.maps.LatLng(43.253205,-80.480347), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var geocoder = new google.maps.Geocoder(); var marker, i; for (i = 0; i < locations.length; i++) { geocoder.geocode( { 'address': locations[i][1]}, function(results, status) { //alert(status); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); map.setCenter(results[0].geometry.location); marker = new google.maps.Marker({ position: results[0].geometry.location, map: map }); google.maps.event.addListener(marker, 'mouseover', function() { infowindow.open(marker, map);}); google.maps.event.addListener(marker, 'mouseout', function() { infowindow.close();}); } else { alert("some problem in geocode" + status); } }); } </script> </body> </html>

    Read the article

  • jQuery dont see onclick event on link inside infowindow in google maps v3

    - by Charles
    i have such problem that jQuery onclick event dont see click on link inside google map in infowindow. Thats how my infowindow link looks like: <a href="http://example.com/#ui-accordion-accordion-header-7" class="pull-right move-to-acc" id="itemH">See Details</a> Under map i have acordion list with detailed information about point so im trying to catch click on that link : jQuery("#itemH").click(function(event){ alert("qq"); }); When i click on marker infowindow open and i click on link but alert dont show up - im just moved to div #ui-accordion-accordion-header-7 What im doing wrong ? Thx for help

    Read the article

  • Visual Studio compiles WPF application twice during build

    - by Brian Ensink
    I have a WPF app in VS2008 that compiles twice during the build. The two CSC command lines are similar but with some differences. The first CSC command line does not have an /resource options, the second has two /resource options on the command line. The second CSC command line has these additional arguments: /resource:"obj\Debug AutoCAD\VisualApp.g.resources" /resource:"obj\Debug AutoCAD\CAP.Visual.Properties.Resources.resources" I hate to post such a huge ugly compiler output but here are both command lines. 2>c:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\BIN\RELEASE\FOO.Base.dll /reference:..\BIN\RELEASE\FOO.CAPArchiveHandler.dll /reference:..\BIN\RELEASE\FOO.CAPDOM.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.Docking.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.Navigation.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\UIAutomationProvider.dll" /reference:c:\project\FooStudio\BIN\DEBUGCAD\VS-3DEngine-Wrapper.dll /reference:c:\project\FooStudio\BIN\DEBUGCAD\VisualServiceClient.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll" /debug+ /debug:full /filealign:512 /out:"obj\Debug AutoCAD\VisualApp.exe" /target:winexe App.xaml.cs MainWindow.xaml.cs CameraAndLightingControl.xaml.cs CameraAndLightingViewModel.cs MainWindowViewModel.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs ScenarioToolsWindow.xaml.cs SceneGraph.cs ScenePart.cs ToolWindow.xaml.cs "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\CameraAndLightingControl.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\MainWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\ScenarioToolsWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\ToolWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\App.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\GeneratedInternalTypeHelper.g.cs" 2>Done building project "0ye0i4wb.tmp_proj". 2>c:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\BIN\RELEASE\FOO.Base.dll /reference:..\BIN\RELEASE\FOO.CAPArchiveHandler.dll /reference:..\BIN\RELEASE\FOO.CAPDOM.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.Docking.dll" /reference:"C:\Program Files\Telerik\RadControls for WPF Q1 2010\Binaries\WPF\Telerik.Windows.Controls.Navigation.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\UIAutomationProvider.dll" /reference:c:\project\FooStudio\BIN\DEBUGCAD\VS-3DEngine-Wrapper.dll /reference:c:\project\FooStudio\BIN\DEBUGCAD\VisualServiceClient.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll" /debug+ /debug:full /filealign:512 /out:"obj\Debug AutoCAD\VisualApp.exe" /resource:"obj\Debug AutoCAD\VisualApp.g.resources" /resource:"obj\Debug AutoCAD\FOO.Visual.Properties.Resources.resources" /target:winexe App.xaml.cs MainWindow.xaml.cs CameraAndLightingControl.xaml.cs CameraAndLightingViewModel.cs MainWindowViewModel.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs ScenarioToolsWindow.xaml.cs SceneGraph.cs ScenePart.cs ToolWindow.xaml.cs "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\CameraAndLightingControl.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\MainWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\ScenarioToolsWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\ToolWindow.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\App.g.cs" "c:\project\FooStudio\VisualApp\obj\Debug AutoCAD\GeneratedInternalTypeHelper.g.cs" Any idea what could possibly cause this? I think this is causing a problem I posted about earlier today.

    Read the article

  • How can I get penetration depth from Minkowski Portal Refinement / Xenocollide?

    - by Raven Dreamer
    I recently got an implementation of Minkowski Portal Refinement (MPR) successfully detecting collision. Even better, my implementation returns a good estimate (local minimum) direction for the minimum penetration depth. So I took a stab at adjusting the algorithm to return the penetration depth in an arbitrary direction, and was modestly successful - my altered method works splendidly for face-edge collision resolution! What it doesn't currently do, is correctly provide the minimum penetration depth for edge-edge scenarios, such as the case on the right: What I perceive to be happening, is that my current method returns the minimum penetration depth to the nearest vertex - which works fine when the collision is actually occurring on the plane of that vertex, but not when the collision happens along an edge. Is there a way I can alter my method to return the penetration depth to the point of collision, rather than the nearest vertex? Here's the method that's supposed to return the minimum penetration distance along a specific direction: public static Vector3 CalcMinDistance(List<Vector3> shape1, List<Vector3> shape2, Vector3 dir) { //holding variables Vector3 n = Vector3.zero; Vector3 swap = Vector3.zero; // v0 = center of Minkowski sum v0 = Vector3.zero; // Avoid case where centers overlap -- any direction is fine in this case //if (v0 == Vector3.zero) return Vector3.zero; //always pass in a valid direction. // v1 = support in direction of origin n = -dir; //get the differnce of the minkowski sum Vector3 v11 = GetSupport(shape1, -n); Vector3 v12 = GetSupport(shape2, n); v1 = v12 - v11; //if the support point is not in the direction of the origin if (v1.Dot(n) <= 0) { //Debug.Log("Could find no points this direction"); return Vector3.zero; } // v2 - support perpendicular to v1,v0 n = v1.Cross(v0); if (n == Vector3.zero) { //v1 and v0 are parallel, which means //the direction leads directly to an endpoint n = v1 - v0; //shortest distance is just n //Debug.Log("2 point return"); return n; } //get the new support point Vector3 v21 = GetSupport(shape1, -n); Vector3 v22 = GetSupport(shape2, n); v2 = v22 - v21; if (v2.Dot(n) <= 0) { //can't reach the origin in this direction, ergo, no collision //Debug.Log("Could not reach edge?"); return Vector2.zero; } // Determine whether origin is on + or - side of plane (v1,v0,v2) //tests linesegments v0v1 and v0v2 n = (v1 - v0).Cross(v2 - v0); float dist = n.Dot(v0); // If the origin is on the - side of the plane, reverse the direction of the plane if (dist > 0) { //swap the winding order of v1 and v2 swap = v1; v1 = v2; v2 = swap; //swap the winding order of v11 and v12 swap = v12; v12 = v11; v11 = swap; //swap the winding order of v11 and v12 swap = v22; v22 = v21; v21 = swap; //and swap the plane normal n = -n; } /// // Phase One: Identify a portal while (true) { // Obtain the support point in a direction perpendicular to the existing plane // Note: This point is guaranteed to lie off the plane Vector3 v31 = GetSupport(shape1, -n); Vector3 v32 = GetSupport(shape2, n); v3 = v32 - v31; if (v3.Dot(n) <= 0) { //can't enclose the origin within our tetrahedron //Debug.Log("Could not reach edge after portal?"); return Vector3.zero; } // If origin is outside (v1,v0,v3), then eliminate v2 and loop if (v1.Cross(v3).Dot(v0) < 0) { //failed to enclose the origin, adjust points; v2 = v3; v21 = v31; v22 = v32; n = (v1 - v0).Cross(v3 - v0); continue; } // If origin is outside (v3,v0,v2), then eliminate v1 and loop if (v3.Cross(v2).Dot(v0) < 0) { //failed to enclose the origin, adjust points; v1 = v3; v11 = v31; v12 = v32; n = (v3 - v0).Cross(v2 - v0); continue; } bool hit = false; /// // Phase Two: Refine the portal int phase2 = 0; // We are now inside of a wedge... while (phase2 < 20) { phase2++; // Compute normal of the wedge face n = (v2 - v1).Cross(v3 - v1); n.Normalize(); // Compute distance from origin to wedge face float d = n.Dot(v1); // If the origin is inside the wedge, we have a hit if (d > 0 ) { //Debug.Log("Do plane test here"); float T = n.Dot(v2) / n.Dot(dir); Vector3 pointInPlane = (dir * T); return pointInPlane; } // Find the support point in the direction of the wedge face Vector3 v41 = GetSupport(shape1, -n); Vector3 v42 = GetSupport(shape2, n); v4 = v42 - v41; float delta = (v4 - v3).Dot(n); float separation = -(v4.Dot(n)); if (delta <= kCollideEpsilon || separation >= 0) { //Debug.Log("Non-convergance detected"); //Debug.Log("Do plane test here"); return Vector3.zero; } // Compute the tetrahedron dividing face (v4,v0,v1) float d1 = v4.Cross(v1).Dot(v0); // Compute the tetrahedron dividing face (v4,v0,v2) float d2 = v4.Cross(v2).Dot(v0); // Compute the tetrahedron dividing face (v4,v0,v3) float d3 = v4.Cross(v3).Dot(v0); if (d1 < 0) { if (d2 < 0) { // Inside d1 & inside d2 ==> eliminate v1 v1 = v4; v11 = v41; v12 = v42; } else { // Inside d1 & outside d2 ==> eliminate v3 v3 = v4; v31 = v41; v32 = v42; } } else { if (d3 < 0) { // Outside d1 & inside d3 ==> eliminate v2 v2 = v4; v21 = v41; v22 = v42; } else { // Outside d1 & outside d3 ==> eliminate v1 v1 = v4; v11 = v41; v12 = v42; } } } return Vector3.zero; } }

    Read the article

  • Google Maps Polygon - Not creating independent

    - by ferronrsmith
    I am basically populating a map with polygons, I am using the flex sdk. The problem I am having is that each time it adds a parish it keep adding to the previous polygons and treating it as one. HELP!! <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%" key="ABQIAAAAGe0Fqwt-nY7G2oB81ZIicRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRcFmaI_t1gtsS5UN6mWQkH9kIw6Q"/> <mx:Script> <![CDATA[ import com.google.maps.Color; import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; import com.google.maps.controls.ZoomControl; import com.google.maps.overlays.Polygon; import com.google.maps.overlays.PolygonOptions; import com.google.maps.styles.FillStyle; import com.google.maps.styles.StrokeStyle; import mx.controls.Alert; import mx.utils.ColorUtil; import mx.utils.object_proxy; private var polys:Array = new Array(); private var labels:Array = new Array(); // private var pts:Array = new Array(); // private var poly:Polygon; // private var map:Map; private function onMapReady(event:Event):void { map.setCenter(new LatLng(18.070146,-77.225647), 9, MapType.NORMAL_MAP_TYPE); map.addControl(new ZoomControl()); map.enableScrollWheelZoom(); map.enableContinuousZoom(); getXml(); } public function getXml():void { var xmlString:URLRequest = new URLRequest("parish.xml"); var xmlLoader:URLLoader = new URLLoader(xmlString); xmlLoader.addEventListener("complete", readXml); } private function readXml(event:Event):void { var markersXML:XML = new XML(event.target.data); var markers:XMLList = markersXML..parish; //var markersCount:int = markers.length(); var i:Number; var t:Number; for(i=0; i < markers.length(); i++) { var marker:XML = markers[i]; var name:String = marker.@name; var colour:String = marker.@colour; // Alert.show(""); var the_p:XMLList = markers..point; var pts:Array = []; for(t=0; t < the_p.length(); t++) { var theparish:XML = the_p[t]; pts[t] = new LatLng(theparish.@lat,theparish.@lng); // Alert.show("working" + theparish.@lat); // var pts.push(new LatLng(theparish.@lat,theparish.@lng)); } var poly:Polygon = new Polygon(pts, new PolygonOptions({ strokyStyle: new StrokeStyle({ color: colour, thickness: 1, alpha: 0.2}), fillStyle: new FillStyle({ color: colour, alpha: 0.2}) })); //polys.push(poly); //labels.push(name); Alert.show("this"); pts = [] map.addOverlay(poly); } } /* public function createMarker(latlng:LatLng, name:String, address:String, type:String): Marker { var marker:Marker = new Marker(latlng, new MarkerOptions({icon: new customIcons[type], iconOffset: new Point(-16, -32)})); var html:String = "<b>" + name + "</b> <br/>" + address; marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void { marker.openInfoWindow(new InfoWindowOptions({contentHTML:html})); }); return marker; } */ ]]> </mx:Script> </mx:Application>

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >